threads / discuss / 19618

inconsistency with --abbrev=0

Subject: inconsistency with --abbrev=0

## tl;dr

3 messages between May 31, 2009 and Jun 1, 2009.

replies: 2people: 2as markdown or json

Markus Heidelberg· May 31, 2009, 15:48 UTC · lore
The minimum (>=4) number of chars is shown by
  git log|show|whatchanged --abbrev-commit --raw --abbrev=0
  git rev-list --abbrev-commit --abbrev=0 HEAD
  git show-ref --abbrev=0
  and the various diff commands
All 40 are shown by
  git branch -v --abbrev=0
  git ls-files --stage --abbrev=0
  git ls-tree --abbrev=0 HEAD

The latter group uses parse-options and doesn't set abbrev to 4 in this case. This is needed for git-describe to omit the output of the commit.

What should --abbrev=0 behave like?
Markus
Sverre Rabbelier· May 31, 2009, 17:46 UTC · re: Markus Heidelberg · lore

Re: inconsistency with --abbrev=0

Heya,

On Sun, May 31, 2009 at 17:48, Markus Heidelberg <markus.heidelberg@web.de> wrote:

> What should --abbrev=0 behave like?

If the minimum is 4, then --abbrev=n with n < 4 should give an error saying that it should be >= 4, no?

-- 
Cheers,

Sverre Rabbelier
Markus Heidelberg· Jun 1, 2009, 10:36 UTC · re: Sverre Rabbelier · lore

Re: inconsistency with --abbrev=0

Sverre Rabbelier, 31.05.2009:
Show 8 quoted lines
> Heya,
> 
> On Sun, May 31, 2009 at 17:48, Markus Heidelberg
> <markus.heidelberg@web.de> wrote:
> > What should --abbrev=0 behave like?
> 
> If the minimum is 4, then --abbrev=n with n < 4 should give an error
> saying that it should be >= 4, no?

This would break existing workflows. Currently --abbrev=[1-3] (and also --abbrev=-n (negative numbers)) always display >=4 chars in all commands. So you don't have to remind git's lower limit of 4, if you just want to display as few chars as possible. Only --abbrev=0 is different.

Markus

← back to recent threads