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

Re: Proposal: create meaningful aliases for git reset's hard/soft/mixed

From
PVPhilippe Vaucher <philippe.vaucher@gmail.com>
Date
Nov 23, 2011, 23:00 UTC
Message-ID
<CAGK7Mr5nQoubAw11KDj4WKwQnXrfgteKbMj2=AR-HhsGKi52wQ@mail.gmail.com>
In-Reply-To
<7vlir6brjw.fsf@alter.siamese.dyndns.org>
>> "I want to discard my changes" --> git reset --all HEAD^
>
> That is discarding your changes and also the last commit.
Yes, of course.
Show 9 quoted lines
>> "I want to discard the last commit" --> git reset --index HEAD^
>
> I do not think this has a clear meaning. "discard the last commit but
> leave the contents in the working tree. I do not care a newly added files
> are forgotten by the index, I'll remember to re-add them if I need to" is
> what you are saying here, but the word "index" does not hint it.  When
> used as an option name, "--index" means "this command usually works on or
> touches working tree but for this invocation please also affect the index";
> "please look at or affect _only_ the index" is usually spelled "--cached".

Well, it's certainly a bit more descriptive and easy to remember than "--mixed". I understand it could confuse people because of the other commands, but maybe something like "--index-only"?

> In any case, I think your proposal makes it even worse than the current
> state, and you should aim higher.

Why worse? I'd understand if you said it's doesn't improve it enough for it to be worth the change tho. Anyway, my proposal was to get a discussion going, and I'm all for aiming higher if there's a way. What do you propose instead? You seemed to imply we'd remove --soft and --merge, and make --keep as an option for --hard but named differently, something like --keep-changes. Maybe I didn't fully understand.

Mathieu even suggested that it'd have the behavior of --keep by default, and that you have to add --force to get today's --hard behavior, which sounds like a good idea to me (avoid destructive behavior by default).

Philippe
Previous: Junio C HamanoNext: Phil Hord
Message 7 of 22 in “Proposal: create meaningful aliases for git reset's hard/soft/mixed”
  1. Philippe VaucherNov 23, 2011
  2. Matthieu MoyNov 23, 2011
  3. Philippe VaucherNov 23, 2011
  4. Martin von ZweigbergkDec 18, 2012
  5. Nguyen Thai Ngoc DuyNov 23, 2011
  6. Junio C HamanoNov 23, 2011
  7. Philippe VaucherNov 23, 2011
  8. Phil HordDec 1, 2011
  9. Thomas RastDec 2, 2011
  10. Miles BaderDec 2, 2011
  11. Phil HordDec 2, 2011
  12. Philippe VaucherDec 2, 2011
  13. Phil HordDec 2, 2011
  14. Philippe VaucherDec 6, 2011
  15. Phil HordOct 3, 2012
  16. Junio C HamanoOct 3, 2012
  17. Junio C HamanoOct 3, 2012
  18. Jan EngelhardtDec 15, 2012
  19. Phil HordDec 1, 2011
  20. Martin von ZweigbergkDec 18, 2012
  21. Junio C HamanoDec 18, 2012
  22. Jeff KingDec 18, 2012

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.