2

I'd like to enable rebase.abbreviateCommands. I added the lines below to my git file (~/.gitconfig), saved, opened a new terminal, cd to a git repo, then attempted a git rebase -i HEAD~, and I still "pick" instead of "p". I confirmed git is using this file by removing configurations and observing changes, and by running git config -l.

[rebase]
        abbreviateCommands = true

Doc: https://git-scm.com/docs/git-config (search for abbreviateCommands)

Agrim Pathak
  • 3,047
  • 4
  • 27
  • 43
  • Not directly related to the answer (which is almost certainly "your Git is older"), but: why do you care how long the word in the generated file is? I'm curious since I do not quite understand why they added this "abbreviateCommands" feature in the first place. Might be because I use vi/vim and just type `cw` to change any given command, so `cwe` is no more work regardless of whether it says `pick` or `p`... – torek Aug 16 '18 at 00:53
  • @torek That works. I do use vim, but I mapped c to something else (time to undo that). I've been typing `dwie`, when I felt `re` would be much more comfortable. – Agrim Pathak Aug 16 '18 at 01:00
  • vim has the search-for-unused-command-sequence beat all hollow, vs original vi :-) (I started making use of `:map ` a while back. See https://stackoverflow.com/q/1764263/1256452.) – torek Aug 16 '18 at 01:13
  • @torek Until I get 2.16, I'll use this: `map e :s/pick/e ` – Agrim Pathak Aug 16 '18 at 03:56

2 Answers2

4

rebase.abbreviateCommands was new in Git version 2.16.0. What Git version are you running?

torek
  • 448,244
  • 59
  • 642
  • 775
3

If you do use rebase.abbreviateCommands, consider the latest With Git 2.27 (Q2 2020):
"git rebase" with the merge backend did not work well when the rebase.abbreviateCommands configuration was set before 2.27.

See commit de9f1d3, commit 68e7090 (30 Mar 2020) by Alban Gruin (agrn).
(Merged by Junio C Hamano -- gitster -- in commit f72e067, 22 Apr 2020)

sequencer: don't abbreviate a command if it doesn't have a short form

Signed-off-by: Alban Gruin

When the sequencer is requested to abbreviate commands, it will replace those that do not have a short form (eg. noop) by a comment mark.
noop serves no purpose, except when fast-forwarding (ie. by running git rebase).

Removing it will break this command when rebase.abbreviateCommands is set to true.

Teach todo_list_to_strbuf() to check if a command has an actual short form, and to ignore it if not.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250