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

Re: Message from git reset: confusing?

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 5, 2009, 17:21 UTC
Message-ID
<7v1vnqb2hc.fsf@alter.siamese.dyndns.org>
In-Reply-To
<vpqab2e7064.fsf@bauges.imag.fr>
Matthieu Moy <Matthieu.Moy@imag.fr> writes:
> I was wondering what was the motivation for the output of "git merge":
You meant "git reset".
> $ git reset file
> file: locally modified
> $ 
First a tangent.

Removing this output _when no <path> is given_ would greatly reduce the usability of the command.

I often find myself working on something that consists of more than one steps, and initially I decide that these would form, say, two commits A, and B. I first start adding the changes that are relevant to A, and my index gradually gets closer to what A should finally look like.

But then I realize that logically commit B should come before commit A, and it is time to "git reset" without any <path>s. The output would let me review the changes (this includes changes pertaining to both A and B) to help me recall which files would contain changes that are relevant to B.

I agree that "git reset a-single-exact-filename" could be much more silent. I would even say we do not even need -v in such a case.

But the thing is, that is a very narrow special case. The parameter the command takes is not _a file_, but is a set of pathspecs, and I would imagine that when you are in a situation similar to what I just described in a larger project, you would appreciate the same reminder of modified paths when you run the command like this:

    $ git reset include/ arch/x86/

I wouldn't oppose to a patch that squelches the output when all pathspecs given from the command line _exactly_ name existing paths, but I tend to think that it would be usability regression if you do not show any output in a case like the last example.

Previous: Matthieu MoyNext: Avery Pennarun
Message 2 of 20 in “Message from git reset: confusing?”
  1. Matthieu MoyAug 5, 2009
  2. Junio C HamanoAug 5, 2009
  3. Avery PennarunAug 5, 2009
  4. John TapsellAug 5, 2009
  5. Sverre RabbelierAug 5, 2009
  6. Matthieu MoyAug 6, 2009
  7. Junio C HamanoAug 6, 2009
  8. 1/2 Rename REFRESH_SAY_CHANGED to REFRESH_IN_PORCELAIN.Matthieu Moy, Aug 7, 2009
  9. 2/2 reset: make the output more user-friendly.Matthieu Moy, Aug 7, 2009
  10. Junio C HamanoAug 7, 2009
  11. Matthieu MoyAug 8, 2009
  12. Matthieu MoyAug 17, 2009
  13. Junio C HamanoAug 17, 2009
  14. 1/2 Rename REFRESH_SAY_CHANGED to REFRESH_IN_PORCELAIN.Matthieu Moy, Aug 21, 2009
  15. 2/2 reset: make the output more user-friendly.Matthieu Moy, Aug 21, 2009
  16. Junio C HamanoAug 22, 2009
  17. Matthieu MoyAug 22, 2009
  18. Junio C HamanoAug 23, 2009
  19. Matthieu MoyAug 23, 2009
  20. Reece DunnAug 23, 2009

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.