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

Re: [RFC PATCH 0/2] Teach how to discard changes in the working directory

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 7, 2008, 22:48 UTC
Message-ID
<7vtzcrk1wt.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1220825103-19599-1-git-send-email-mail@cup.kalibalik.dk>
Anders Melchiorsen <mail@cup.kalibalik.dk> writes:
Show 5 quoted lines
> Using "git checkout" to undo local changes is a hint that is often
> given in #git. This patch (part 2) adds the hint into the status
> output. A bit of restructuring appears in the initial patch.
>
> This is merely an RFC, I am not sure whether I like it myself :-).

While I think the patch means well, I personally think that the output is already too chatty with these "friendly hints" about add/rm/reset. After this series, will we be adding 'use "git checkout HEAD -- <path>" to go back to the state of the latest commit', and then "if you want to stage only part of the change, use "git add -i <path>"? "To temporarily remove the change use "git stash"?

I would agree that "hint is often given in #git" is an indication that people do not know "git checkout" to check out the path from the index to get rid of the change. I further suspect that "I modified my file and git status says 'Changed but not updated'; what should I do" may not be asked often anymore, which might owe the hint we have in status output. Even then, I do not necessarily agree that the status output (yes, I am also questioning the existing hints as well) is the best place to teach these people.

The approach would lead to insanely long output that reproduces the user manual, and we should draw the line somewhere. As I said, I suspect that what we say is already too chatty.

Previous: Anders MelchiorsenNext: Pieter de Bie
Message 4 of 6 in “Teach how to discard changes in the working directory”
  1. 0/2 Teach how to discard changes in the working directoryAnders Melchiorsen, Sep 7, 2008
  2. 1/2 wt-status: Split header generation into three functionsAnders Melchiorsen, Sep 7, 2008
  3. 2/2 wt-status: Teach how to discard changes in the working directoryAnders Melchiorsen, Sep 7, 2008
  4. Junio C HamanoSep 7, 2008
  5. Pieter de BieSep 7, 2008
  6. Junio C HamanoSep 7, 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.