git/list[1] front-page[2] threads[3] people[4] search[5] about
 

the careless committer and fear of commitment (rebase -i vs add -p)

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Mar 30, 2010, 05:02 UTC
Message-ID
<20100330045704.GA9004@progeny.tock>
In-Reply-To
<32541b131003292132q10db3c5eh1bb6443d625fcb82@mail.gmail.com>
Avery Pennarun wrote:
Show 13 quoted lines
> I generally just make a temporary commit
> with "git commit", then revise it using "git commit --amend" over
> time.
> 
> Or else I make a series of commits, then *later* squash them all
> together using 'git merge --squash' or 'git rebase -i'.
> 
> It seems like the suggested feature would encourage people to do it
> the "wrong" way (not creating temporary commits, thus making it easy
> to make a mistake and blow things away) just because they aren't aware
> of the above options.
> 
> Is there a reason that these methods don't work for you?

I like ‘git diff --cached’ and ‘git diff’ to show the entire list of staged and unstaged changes. I don’t consider this “wrong” at all. Generally, once something becomes precious enough to be worth keeping, it is already in presentable form and I can come up with an appropriate commit message. I understand that other people work differently; this is just my personal preference.

I also use the stash heavily, which maybe mitigates the “content could be blown away with a simple rm -f” problem.

You might also be interested in Pasky’s analysis at http://thread.gmane.org/gmane.comp.version-control.git/138641/focus=138672

Cheers, Jonathan

Previous: Avery PennarunNext: Ramkumar Ramachandra
Message 5 of 7 in “[GSoC Proposal/RFC] Rolling commit message writing”
  1. Daniel ThomasMar 28, 2010
  2. Avery PennarunMar 29, 2010
  3. Jonathan NiederMar 30, 2010
  4. Avery PennarunMar 30, 2010
  5. the careless committer and fear of commitment (rebase -i vs add -p)Jonathan Nieder, Mar 30, 2010
  6. Ramkumar RamachandraMar 30, 2010
  7. Jeff KingMar 30, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.