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

Re: Add porcelain command to revert a single staged file to its HEAD state while preserving its staged state

From
Thomas Rast <trast@inf.ethz.ch>
Date
May 6, 2013, 09:51 UTC
Message-ID
<87r4hkigg4.fsf@linux-k42r.v.cablecom.net>
In-Reply-To
<CADeMBopBvCmb4cz8p8vf-jXaOhfzP3GZKF94Efgsh-NOBs+d3Q@mail.gmail.com>
Dimitar Bonev <dsbonev@gmail.com> writes:
Show 6 quoted lines
> One more argument against the suggestion of doing a commit ahead of
> time is that I like to think in separation to reduce complexity - in
> particular I like to think only for the working dir and index states,
> commits - I treat them as finished work. If I have to amend a commit,
> it is about fixing a mistake - adding/removing a wrong file, fixing a
> typo, that sort of things and not for actual work to be done.

Aside from what's been said already, there's a fundamental problem with your approach: it doesn't scale in any direction. You cannot use it if you want to do the same dance with more than one version "set aside", because the index gives you exactly one more storage area. And it does not generalize in any useful way, whereas using temporary commits is useful also if you want to briefly leave a branch with unfinished work to do something else. Furthermore, knowing how to work with temporary commits (in the plural), and clean them up using 'rebase -i', *is* a part of "work to be done" in most git workflows. Namely, it is used to reshape your branch from a "how did I hack this up" angle into a "how do I explain this to others" angle.

So I hope I'm not misconstruing what Junio and Jonathan said, but I think you can sum up our position as: your proposal is a very specific solution to a very narrow problem -- that is only needed because your environment (PowerShell) is arguably broken. All the while, there are several existing solutions that we consider more natural, and that generalize to other use-cases.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Dimitar BonevNext: Junio C Hamano
Message 8 of 10 in “Add porcelain command to revert a single staged file to its HEAD state while preserving its staged state”
  1. Dimitar BonevMay 4, 2013
  2. Thomas RastMay 4, 2013
  3. Dimitar BonevMay 4, 2013
  4. Jonathan NiederMay 4, 2013
  5. Junio C HamanoMay 4, 2013
  6. Junio C HamanoMay 4, 2013
  7. Dimitar BonevMay 4, 2013
  8. Thomas RastMay 6, 2013
  9. Junio C HamanoMay 6, 2013
  10. Dimitar BonevMay 7, 2013

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.