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

Re: An alternate model for preparing partial commits

From
RARobert Anderson <rwa000@gmail.com>
Date
Jun 28, 2008, 00:08 UTC
Message-ID
<9af502e50806271708p7979ae65k61b71be90efff2c4@mail.gmail.com>
In-Reply-To
<7viqvuo4hq.fsf@gitster.siamese.dyndns.org>
On Fri, Jun 27, 2008 at 4:14 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> "Robert Anderson" <rwa000@gmail.com> writes:
>
>> There are good reasons for desiring a workflow that does not routinely
>> change history as part of the usual workflow.  Maybe there are clones
>> of your repo.  Maybe as part of your workflow discipline you do not
>> want HEAD states that cannot be pushed to public, because you don't
>> want to manually keep track of when it is ok and when it is not ok to
>> push HEAD to public, since git cannot tell you this.
>
> Surely you can arrange that.  You keep track of what you pushed out, and
> you refrain from rebasing beyond that point.

First, the constraint of achieving this workflow when there are clones of the repo in question removes any need for additional rationales.

That being said...

In the existing model which is being suggested as a way to get the desired workflow, there are two distinct classes of commits: commits that are "for real", and commits that are "temporary", that are being used as some kind of workspace for orthogonalizing a set of changes, which will eventually be replaced by "for real" commits. Yet git has no metadata to distinguish these two types of commits. When only "for real" commits exist, I can push HEAD. When "temporary" commits exist, I cannot, or insidious problems will ensue. This metadata concerning "for real" or "temporary" commits is only maintained manually in the developer's head. But, this is the sort of thing that computers are for, and should not be the burden of the developer to maintain this information in his mental cache, especially when the price of making an error can be quite high. It would be very easy to forget that you intended to do more work on your last N commits, and push HEAD because somebody asks you to make sure you've pushed your latest work. Your tools should prevent this kind of scenario. Git cannot, because it doesn't know what you intend when you "commit" because two different ideas are being conflated with "commit" in this model.

In my proposed model, there is a clear distinction, kept track of by git, not the developer, between changes which are in the "temporary workspace" which is still being worked on, and changes which are "for real", that can be shared, either through a push to a public repo or if there are clones of my repo. They become "for real" when they are committed. That's the purpose of a "commit" in this workflow. To bless a change as ready for viewing by others, even if you do not want to make it available yet (by a push to a public repo). I can walk away from a working tree for six months, come back, and there can be no confusion about which changes were "temporary" and possibly in need of revision, and which changes are blessed as ready for public consumption. If I come back to a branch on which there are several commits which have not been pushed yet, how do I know which are "temporary" and which are "for real" commits? I cannot. It is impossible. The information is not there.

But, all of this is moot when you consider the simple case of a repo which has been cloned, on which you'd like to make partial commits, and test the committed state before doing so.

Thanks, Bob

Previous: Junio C HamanoNext: Dmitry Potapov
Message 41 of 57 in “An alternate model for preparing partial commits”
  1. Robert AndersonJun 27, 2008
  2. Björn SteinbrinkJun 27, 2008
  3. stash: introduce 'stash save --keep-index' optionSZEDER Gábor, Jun 27, 2008
  4. Junio C HamanoJun 27, 2008
  5. Robert AndersonJun 27, 2008
  6. Björn SteinbrinkJun 27, 2008
  7. Robert AndersonJun 27, 2008
  8. Johannes SixtJun 27, 2008
  9. Robert AndersonJun 27, 2008
  10. Petr BaudisJun 27, 2008
  11. Robert AndersonJun 27, 2008
  12. Johannes SchindelinJun 27, 2008
  13. Miklos VajnaJun 27, 2008
  14. Robert AndersonJun 27, 2008
  15. Johannes SchindelinJun 27, 2008
  16. Robert AndersonJun 27, 2008
  17. Dana HowJun 27, 2008
  18. Stephen SinclairJun 27, 2008
  19. David JeskeJun 27, 2008
  20. David JeskeAug 13, 2016
  21. Wincent ColaiutaJun 28, 2008
  22. Dmitry PotapovJun 28, 2008
  23. Robert AndersonJun 28, 2008
  24. Dmitry PotapovJun 28, 2008
  25. Junio C HamanoJun 27, 2008
  26. Robert AndersonJun 27, 2008
  27. Jeff KingJun 28, 2008
  28. Robert AndersonJun 28, 2008
  29. Jeff KingJun 28, 2008
  30. Junio C HamanoJun 28, 2008
  31. Johannes SchindelinJun 28, 2008
  32. Jeff KingJul 8, 2008
  33. David JeskeJun 27, 2008
  34. Jakub NarebskiJun 27, 2008
  35. David JeskeJun 27, 2008
  36. David JeskeAug 13, 2016
  37. David JeskeAug 13, 2016
  38. Robert AndersonJun 27, 2008
  39. Robert AndersonJun 27, 2008
  40. Junio C HamanoJun 27, 2008
  41. Robert AndersonJun 28, 2008
  42. Dmitry PotapovJun 28, 2008
  43. Robert AndersonJun 28, 2008
  44. Stephen SinclairJun 28, 2008
  45. Robert AndersonJun 28, 2008
  46. Robert AndersonJun 28, 2008
  47. Jakub NarebskiJun 28, 2008
  48. Robert AndersonJun 28, 2008
  49. David JeskeJun 28, 2008
  50. David JeskeAug 13, 2016
  51. Stephen SinclairJun 28, 2008
  52. David JeskeJun 28, 2008
  53. David JeskeAug 13, 2016
  54. Fwd: An alternate model for preparing partial commitsRobert Anderson, Jun 28, 2008
  55. Dmitry PotapovJun 28, 2008
  56. Robert AndersonJun 28, 2008
  57. Dmitry PotapovJun 28, 2008

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.