feat: add --init and --commit flags for git initialization after clone#63
feat: add --init and --commit flags for git initialization after clone#63bryanprimus wants to merge 11 commits intonrjdalal:mainfrom
Conversation
ReviewOverviewAdds Strengths
Issues / Risks1. Watch mode will fail on the second tick ( 2. 3. Blob target without a directory pollutes CWD. 4. Hard-coded 5. 6. Help-text alignment. TestsFour new tests cover tree/blob × init/commit happy paths. Gaps worth adding:
Security
RecommendationApprove after addressing #1 (watch-mode re-commit) and #2 (graceful failure when git identity is unset). The other items are polish. |
|
One more thought: there's no default commit message right now — gitpick owner/repo --commit # → "init awesomeness" |
initialize and commit once
|
Thanks for the review!! I've pushed updates addressing all your points:
Let me know if something is still missing. 🙏 |
adds two new CLI flags that let users initialize a git repository and optionally
create an initial commit immediately after cloning with no extra manual steps needed.
closes #61
Motivation
gitpickintentionally strips the.gitdirectory when cloning, which is greatfor scaffolding. But users who want to immediately start tracking their own changes
had to manually run
git init(and optionallygit add . && git commit) afterevery clone. This PR adds support to automate that workflow.
Changes
--init(boolean)Initializes the target directory as a new git repository after cloning.
git initinside the target directory.git initin the parent directory (the natural repo root)..gitdirectory already exists (idempotent).--commit <msg>/-m <msg>(string)Stages all cloned files and creates an initial git commit with the provided message.
--init-> no need to pass both flags.git add .thengit commit -m <msg>after initialization.Usage