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

Re: [PATCH v3 0/6] rebase -i: add config to abbreviate command-names

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
May 2, 2017, 08:48 UTC
Message-ID
<CACBZZX5MacQZHVjSymWm0_RHjc_Q41J9vhqMuDGwz3L_4LjtzQ@mail.gmail.com>
In-Reply-To
<20170502040048.9065-1-liambeguin@gmail.com>
On Tue, May 2, 2017 at 6:00 AM, Liam Beguin <liambeguin@gmail.com> wrote:
Show 32 quoted lines
> Add the 'rebase.abbreviateCommands' configuration option to allow
> `git rebase -i` to default to the single-letter command-names in
> the todo list.
>
> Using single-letter command-names can present two benefits.
> First, it makes it easier to change the action since you only need to
> replace a single character (i.e.: in vim "r<character>" instead of
> "ciw<character>").
> Second, using this with a large enough value of 'core.abbrev' enables the
> lines of the todo list to remain aligned making the files easier to
> read.
>
> Changes from v1 to v2:
>  - Improve Documentation and commit message
>
> Changes from v2 to v3:
>  - Transform a single patch into a series
>  - change option name from 'rebase.abbrevCmd' to 'rebase.abbreviateCommands'
>  - abbreviate all commands (not just pick)
>  - teach `git rebase -i --autosquash` to recognise single-letter command-names
>  - move rebase configuration documentation to Documentation/rebase-config.txt
>  - update Documentation to use the preferred naming for the todo list
>  - update Documentation and commit messages according to feedback
>
> Liam Beguin (6):
>   rebase -i: add abbreviated command-names handling
>   rebase -i: add abbreviate_commands function
>   rebase -i: add short command-name in --autosquash
>   Documentation: move rebase.* config variables to a separate
>     rebase-config.txt
>   Documentation: use prefered name for the 'todo list' script
>   Documentation: document the rebase.abbreviateCommands option
I locally rebased this into just 3 patches, i.e. in this sequence:
- Documentation: move rebase.* config variables to a separate rebase-config.txt
- Documentation: use preferred name for the 'todo list' script
- *all the rest of this squashed*

I think that's much less confusing than having 3x "rebase -i" patches. If you look at any one of those you have very little context for what's going on, and there seems to be no point in splitting them since the end result is tiny (3 files changed, 45 insertions(+), 4 deletions(-)).

I think with that this looks good, but it also needs tests, if you apply your series and then comment out the new calls to abbreviate_commands all tests still pass, if you look at git-config(1) and search for the other rebase.* commands & grep the test suite for those you can see how they're tested for.

I don't think this needs a lot of testing since it's a rather trivial feature, but just one test to make sure that the todo list ends up as "p ..." "e ..." instead of "pick ..." "exec ..." etc. would be good.

Show 10 quoted lines
>  Documentation/config.txt        | 31 +-----------------------
>  Documentation/git-rebase.txt    | 21 +++-------------
>  Documentation/rebase-config.txt | 53 +++++++++++++++++++++++++++++++++++++++++
>  git-rebase--interactive.sh      | 24 ++++++++++++++++++++----
>  4 files changed, 78 insertions(+), 52 deletions(-)
>  create mode 100644 Documentation/rebase-config.txt
>
> --
> 2.9.3
>
Previous: Liam BeguinNext: Johannes Schindelin
Message 13 of 21 in “rebase -i: add config to abbreviate command-names”
  1. 0/6 rebase -i: add config to abbreviate command-namesLiam Beguin, May 2, 2017
  2. 1/6 rebase -i: add abbreviated command-names handlingLiam Beguin, May 2, 2017
  3. Johannes SchindelinMay 2, 2017
  4. 2/6 rebase -i: add abbreviate_commands functionLiam Beguin, May 2, 2017
  5. Johannes SchindelinMay 2, 2017
  6. 3/6 rebase -i: add short command-name in --autosquashLiam Beguin, May 2, 2017
  7. Johannes SchindelinMay 2, 2017
  8. Liam BeguinMay 2, 2017
  9. 6/6 Documentation: document the rebase.abbreviateCommands optionLiam Beguin, May 2, 2017
  10. 4/6 Documentation: move rebase.* config variables to a separate rebase-config.txtLiam Beguin, May 2, 2017
  11. Johannes SchindelinMay 2, 2017
  12. 5/6 Documentation: use preferred name for the 'todo list' scriptLiam Beguin, May 2, 2017
  13. Ævar Arnfjörð BjarmasonMay 2, 2017
  14. Johannes SchindelinMay 2, 2017
  15. Johannes SchindelinMay 2, 2017
  16. Liam BeguinMay 2, 2017
  17. Johannes SchindelinMay 3, 2017
  18. Junio C HamanoMay 4, 2017
  19. Liam BeguinMay 7, 2017
  20. Junio C HamanoMay 8, 2017
  21. Liam BeguinMay 8, 2017

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.