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

Re: non-empty index with git commit -a

From
Jeff King <peff@peff.net>
Date
Feb 16, 2011, 03:27 UTC
Message-ID
<20110216032715.GA1666@sigill.intra.peff.net>
In-Reply-To
<20110216032047.GA2858@elie>
On Tue, Feb 15, 2011 at 09:20:47PM -0600, Jonathan Nieder wrote:
Show 28 quoted lines
> Jeff King wrote:
> > On Tue, Feb 15, 2011 at 10:43:53PM +0000, Sverre Rabbelier wrote:
> 
> >> Can we please fix this?
> >>
> >> $ hack hack hack
> >> $ git add -p # carefully add my changes
> >> $ git commit -am "Add feature foo"
> >> $ DAAAMN YOUUU FINGERS!!
> >>
> >> I remember bringing this up before, but I can't remember what the
> >> discussion ended up coming to.
> >
> > How do you differentiate this from:
> >
> >   $ hack hack hack
> >   $ git add -p ;# carefully add my changes
> >   $ hack hack hack
> >   $ git diff ;# ok, everything looks good
> >   $ git commit -am "Add feature foo"
> >
> > ?
> 
> If I remember the discussion[1] correctly, by requiring a separate
> add -u step (or commit -f -a) if the "I don't trust my fingers"
> configuration is enabled.
> 
> [1] http://thread.gmane.org/gmane.linux.debian.devel.bugs.general/698001/focus=145662

Thanks for the link, I didn't recall that discussion. I have no problem with a config option that requires an extra step, but such a safety valve should definitely be optional, since the current behavior is part of a perfectly reasonable workflow.

-Peff
Previous: Jonathan NiederNext: Sverre Rabbelier
Message 4 of 25 in “non-empty index with git commit -a”
  1. Sverre RabbelierFeb 15, 2011
  2. Jeff KingFeb 16, 2011
  3. Jonathan NiederFeb 16, 2011
  4. Jeff KingFeb 16, 2011
  5. Sverre RabbelierFeb 16, 2011
  6. Nguyen Thai Ngoc DuyFeb 16, 2011
  7. Jonathan NiederFeb 16, 2011
  8. Jeff KingFeb 16, 2011
  9. Sverre RabbelierFeb 16, 2011
  10. Jeff KingFeb 16, 2011
  11. Sverre RabbelierFeb 16, 2011
  12. Jeff KingFeb 16, 2011
  13. Michael J GruberFeb 16, 2011
  14. Jeff KingFeb 16, 2011
  15. Junio C HamanoFeb 16, 2011
  16. Jeff KingFeb 16, 2011
  17. Junio C HamanoFeb 16, 2011
  18. Jeff KingFeb 16, 2011
  19. Jakub NarebskiFeb 16, 2011
  20. Junio C HamanoFeb 16, 2011
  21. Jeff KingFeb 16, 2011
  22. Matthieu MoyFeb 16, 2011
  23. Jeff KingFeb 16, 2011
  24. Junio C HamanoFeb 16, 2011
  25. Matthieu MoyFeb 16, 2011

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.