RE: [PATCH] rebase -i: respect to core.abbrev
- From
Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
- Date
- Sep 28, 2013, 21:10 UTC
- Message-ID
- <20130928211013.54361E0090@blue.fi.intel.com>
- In-Reply-To
- <1380384435-20846-1-git-send-email-kirill.shutemov@linux.intel.com>
Kirill A. Shutemov wrote:
Show 19 quoted lines
> git rebase -i collapses ids on todo list to 7 hexdigits.
> Let's use core.abbrev config option instead, if it's set.
>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> ---
> git-rebase--interactive.sh | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
> index 10bf318d0d..078c28ff1b 100644
> --- a/git-rebase--interactive.sh
> +++ b/git-rebase--interactive.sh
> @@ -713,7 +713,8 @@ expand_todo_ids() {
> }
>
> collapse_todo_ids() {
> - transform_todo_ids --short=7
> + abbrev="$(git config --get 'core.abbrev')"
> + transform_todo_ids --short="${abbrev:-7}"Simpler version is below.
>From 933a4159f0c037a37f3b251a4f13deea7f17b6c3 Mon Sep 17 00:00:00 2001
From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> Date: Sat, 28 Sep 2013 18:53:05 +0300 Subject: [PATCH] rebase -i: respect to core.abbrev
collapse_todo_ids() uses `git rev-parse --short=7' to abbrev commit ids. Let's drop argument from --short to use default (7) or config value instead.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> --- git-rebase--interactive.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index 10bf318d0d..3c6bed9a28 100644 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -713,7 +713,7 @@ expand_todo_ids() { } collapse_todo_ids() { - transform_todo_ids --short=7 + transform_todo_ids --short } # Rearrange the todo list that has both "pick sha1 msg" and
-- Kirill A. Shutemov