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

Re: [PATCH] Documentation: add a planning document for the next CLI revamp

From
Elijah Newren <newren@gmail.com>
Date
Nov 1, 2008, 20:27 UTC
Message-ID
<51419b2c0811011327j492b520dq2388fc8972b48cab@mail.gmail.com>
In-Reply-To
<1225389068.19891.28.camel@maia.lan>
Hi,
(Sorry for sending so many emails, and being late to the conversation.
 There's a couple others that I wanted to respond to but I'll wait off
on those and finish with this email to avoid spamming everyone any
more right now.)
On Thu, Oct 30, 2008 at 11:51 AM, Sam Vilain <sam@vilain.net> wrote:
Show 12 quoted lines
> Well, I don't have strong feelings on the exact command name used; I
> suggested "undo", probably also ambiguous.  But still, a significant
> number of users are surprised when they type 'git revert' and they get a
> backed out patch.  It's such an uncommon operation, it doesn't deserve
> to be triggered so easily.  And reverting files to the state in the
> index and/or HEAD is a common operation that deserves being short to
> type.
>
> Making it plain "revert" would violate expectations of existing users;
> it seems a better idea to just deprecate it, and point the users to the
> new method - cherry-pick --revert - or the command they might have meant
> - whatever that becomes.

There is another option, though it has its own problems too. There are basically two kinds of reverting here -- reverting all the changes *in* a given revision (which I'll called 'revert-in') and reverting all the changes *since* a given revision (typically HEAD; I'll call this 'revert-since'). These two operations can be supported from the same command, though their use cases are different enough that it may seem slightly weird:

     revert-since                        revert-in
     * is usually used in a dirty tree   * is typically used in a clean tree
     * specific paths are usually        * specific paths are not often
       specified                           specified
     * it is rare to want to commit      * making a commit after reverting
       immediately after reverting         is what you usually want
     * it is uncommon to need to
       specify a revision

I decided to combine them in EasyGit, simply because that made things the most discoverable for both existing git and svn/bzr/hg users. The big problem here is that --commit is turned on by default when --in is specified, and --no-commit is the default when --since is specified. Anyway, some examples:

eg revert REVISION => Error -- you must specify either --since or --in when specifying a revision eg revert --in REVISION => Same as git revert REVISION eg revert --since HEAD FILE1 FILE2 => Same as svn revert FILE1 FILE2 eg revert FILE1 FILE2 => shorthand for the previous command; --since HEAD is default when no revision is specified eg revert --since HEAD~3 SUBDIRECTORY => should be clear; an extension over what svn revert can do

Then there's also the possibility that users only want to revert unstaged changes, or only want to revert staged changes...

Anyway, just some food for thought. I've spammed the list enough in this thread, so I'll break for now. Thanks for listening.

Elijah
Previous: Theodore TsoNext: Theodore Tso
Message 44 of 49 in “Documentation: add a planning document for the next CLI revamp”
  1. Documentation: add a planning document for the next CLI revampSam Vilain, Oct 30, 2008
  2. Stefan KarpinskiOct 30, 2008
  3. Kyle MoffettOct 31, 2008
  4. Pierre HabouzitOct 30, 2008
  5. Julian PhillipsOct 30, 2008
  6. Jeff KingOct 31, 2008
  7. Junio C HamanoNov 2, 2008
  8. Pierre HabouzitNov 3, 2008
  9. Nicolas PitreOct 30, 2008
  10. Shawn O. PearceOct 30, 2008
  11. Mike HommeyOct 30, 2008
  12. Pierre HabouzitOct 30, 2008
  13. Nicolas PitreOct 30, 2008
  14. Sam VilainOct 30, 2008
  15. Nicolas PitreOct 30, 2008
  16. Yann DirsonOct 30, 2008
  17. Sam VilainOct 30, 2008
  18. Jakub NarebskiOct 30, 2008
  19. Sam VilainOct 31, 2008
  20. Jakub NarebskiOct 31, 2008
  21. Sam VilainNov 3, 2008
  22. Jakub NarebskiNov 3, 2008
  23. Johannes SchindelinNov 1, 2008
  24. Theodore TsoOct 30, 2008
  25. Pierre HabouzitOct 30, 2008
  26. Theodore TsoOct 30, 2008
  27. Pierre HabouzitOct 30, 2008
  28. Sam VilainOct 30, 2008
  29. Nicolas PitreOct 30, 2008
  30. Junio C HamanoNov 2, 2008
  31. Theodore TsoNov 2, 2008
  32. Andreas EricssonOct 30, 2008
  33. Elijah NewrenNov 1, 2008
  34. Matthieu MoyOct 30, 2008
  35. Nicolas PitreOct 30, 2008
  36. Pierre HabouzitOct 30, 2008
  37. Nicolas PitreOct 30, 2008
  38. Sam VilainOct 30, 2008
  39. Junio C HamanoNov 2, 2008
  40. Sam VilainNov 3, 2008
  41. Elijah NewrenNov 1, 2008
  42. Sam VilainOct 30, 2008
  43. Theodore TsoOct 30, 2008
  44. Elijah NewrenNov 1, 2008
  45. Theodore TsoNov 2, 2008
  46. Elijah NewrenNov 2, 2008
  47. Elijah NewrenNov 1, 2008
  48. Junio C HamanoNov 2, 2008
  49. Elijah NewrenNov 1, 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.