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

Re: [PATCH v2] user-manual: mention git gui citool (commit, amend)

From
Steven Grimm <koreth@midwinter.com>
Date
Aug 6, 2007, 09:36 UTC
Message-ID
<46B6EBAB.4050805@midwinter.com>
In-Reply-To
<Pine.LNX.4.64.0708060119320.14781@racer.site>
Johannes Schindelin wrote:
Show 5 quoted lines
> But how do you make sure that it works as expected?  I.e. when you commit 
> a hunk using, say, variable "rule_the_world", and by mistake (happen to me 
> all the time, maybe to you, too?) forgot to select the hunk which declares 
> that variable, maybe because it is hidden in a forest of other variables?
>   

For cases like that, sure, partial commits are dangerous. On the other hand, I've sometimes done partial commits for things like correcting erroneous comments in code I'm working on, where there is no functional change whatsoever in the hunk I'm committing and where I want to isolate the corrections from the functional changes I *am* working on.

Also, when I'm working on a topic branch in my local sandbox I like to do lots of work-in-progress commits. I usually do those based on the granularity of my mental model of what I'm working on, and I have no expectation whatsoever that any particular percentage of them represent working code or even code that compiles. Sometimes I do partial commits in that situation too: I make a change to some function in a file that I'm editing elsewhere, and commit just that hunk with a commit log message reminding me of why I made the change. Those commits are not intended for public consumption; they're just to help me keep track of my own work. Once everything is in a working state, I do a squash merge or a bunch of cherry-pick -n invocations to build some revisions to publish to the outside world, and *then* I am in "each commit must represent a non-broken state" mode.

The great thing about git (well, *one* of the great things) is that it unifies those two workflows in one system. With, say, svn, the "lots of little checkpoints of my work in progress" part of that is awkward at best, because it's very much oriented around an "if the version control system knows about a change, it is by definition published to the outside world" model.

So I guess my point, after all that, is just that assumptions that are valid in the context of one workflow are not necessarily as valid in others, and that even in a particular context, not all changes are created equal.

-Steve
Previous: Steffen ProhaskaNext: Johannes Schindelin
Message 16 of 34 in “user-manual: mention git gui citool (commit, amend)”
  1. user-manual: mention git gui citool (commit, amend)Steffen Prohaska, Jul 30, 2007
  2. Shawn O. PearceJul 31, 2007
  3. J. Bruce FieldsAug 2, 2007
  4. Steffen ProhaskaAug 2, 2007
  5. J. Bruce FieldsAug 2, 2007
  6. Steffen ProhaskaAug 3, 2007
  7. J. Bruce FieldsAug 3, 2007
  8. user-manual: mention git gui citool (commit, amend)Steffen Prohaska, Aug 5, 2007
  9. Johannes SchindelinAug 5, 2007
  10. Steffen ProhaskaAug 5, 2007
  11. Johannes SchindelinAug 5, 2007
  12. David KastrupAug 5, 2007
  13. Steffen ProhaskaAug 5, 2007
  14. Johannes SchindelinAug 6, 2007
  15. Steffen ProhaskaAug 6, 2007
  16. Steven GrimmAug 6, 2007
  17. Johannes SchindelinAug 6, 2007
  18. J. Bruce FieldsAug 5, 2007
  19. J. Bruce FieldsAug 5, 2007
  20. Johannes SchindelinAug 6, 2007
  21. J. Bruce FieldsAug 6, 2007
  22. Robin RosenbergAug 6, 2007
  23. J. Bruce FieldsAug 6, 2007
  24. Shawn O. PearceAug 3, 2007
  25. J. Bruce FieldsAug 3, 2007
  26. Shawn O. PearceAug 4, 2007
  27. Steffen ProhaskaAug 5, 2007
  28. Junio C HamanoAug 3, 2007
  29. Shawn O. PearceAug 3, 2007
  30. J. Bruce FieldsAug 3, 2007
  31. Shawn O. PearceAug 4, 2007
  32. David KastrupAug 4, 2007
  33. J. Bruce FieldsAug 4, 2007
  34. Steffen ProhaskaAug 5, 2007

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.