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 27, 2008, 17:14 UTC
Message-ID
<9af502e50806271014l661dcfc9o4f61ee2b54677bd6@mail.gmail.com>
In-Reply-To
<alpine.DEB.1.00.0806271408290.9925@racer>

On Fri, Jun 27, 2008 at 6:33 AM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

Show 9 quoted lines
> Hi,
>
> On Thu, 26 Jun 2008, Robert Anderson wrote:
>
>> Seems to me the concept of the "index" is a half-baked version of what
>> I really want, which is the ability to factor a working tree's changes
>> into its constituent parts in preparation for committing them.
>
> Half-baked is probably too strong a word.

It is too subtle. That the index state - which becomes the next committed state - is not available for building or testing before committing is a deep flaw.

> What you are basically asking for is to have the working directory
> as staging area, and to be able to stash away changes that are not to be
> committed.
Correct.
> Now, this is not necessarily what everybody wants, which is why many
> people are fine with the index.

But it is something they should want, and should have, if they care about the quality of their commits. Especially in the common case of a project with development lines which have some sort of policy about build/test requirements. How do you ensure your commits obey that policy if you cannot verify it? That is why the index is not a sufficient mechanism for preparing partial commits. It's fine for quick and dirty operation when the factorization of the conflated changes is obvious and trivial. It is not sufficient otherwise.

Show 5 quoted lines
> Having said that, I played with the idea of a "git stash -i", which would
> allow you to select the changes to stash away.  (And by extension, "git
> stash -e" using the "git add -e" command.)
>
> Hmm?

I meant to mention that - at least in the model I described - this has some overlap with "stash" and could possibly be folded into it.

In my ideal UI, changes (from all changes to hunk level) could be moved back and forth between the stash and the working tree equally easily. Would git stash -i allow that?

For example, if I moved a couple of files into the stash, and then realized I needed one hunk back, could I easily retrieve just that from the stash?

Thanks, Bob

Previous: Miklos VajnaNext: Johannes Schindelin
Message 14 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.