Skip to content

rn20: Changing the default for "core.abbrev"? #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 19, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions rev_news/drafts/edition-20.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,46 @@ This edition covers what happened during the month of September 2016.

### Reviews

* [Changing the default for "core.abbrev"?](http://public-inbox.org/git/CA+55aFy0_pwtFOYS1Tmnxipw9ZkRNCQHmoYyegO00pjMiZQfbg@mail.gmail.com/)

Linus Torvalds asked for increasing the default value for number of
characters in SHA-1 abbreviations. The `default_abbrev = 7` was
reasonable at early days of Git, but the project of size of the
Linux kernel needs `git config --global core.abbrev 12`; while Git
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say "a project of the size of the Linux Kernel" instead but I am not a native speaker so I might be wrong.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I wonder if the semicolon could be replaced by a full stop.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes using "a" here is correct (and probably s/at early days/in the early days/).

I also agree that a period is preferable to a semi-colon here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @peff ! I will make those changes.

will extend the seven hex digits until the object name is unique,
that only reflects the *current* situation in the repository. It gets
annoying when a commit message has a short git ID that is no longer
unique a few months later when one needs to go back and try to figure
out what went wrong in that commit.

Jeff King, alias Peff, answered the *"it gets annoying"* part in the
[[PATCH 0/10] helping people resolve ambiguous sha1s](https://public-inbox.org/git/[email protected]/)
patch series (merged in [66c22ba6](https://git.kernel.org/cgit/git/git.git/commit/?id=66c22ba6fbe0724ecce3d82611ff0ec5c2b0255f)).
This patch series taught Git to help in the situation where only
ambiguous shortened identifier is available, by listing the SHA-1s
of the objects it found, along with a few bits of information that
may help the user decide which one they meant.

> $ git rev-parse b2e1
> error: short SHA1 b2e1 is ambiguous
> hint: The candidates are:
> hint: b2e1196 tag v2.8.0-rc1
> hint: b2e11d1 tree
> hint: b2e1632 commit 2007-11-14 - Merge branch 'bs/maint-commit-options'
> hint: b2e1759 blob
> hint: b2e18954 blob
> hint: b2e1895c blob

The problem of Git providing SHA-1 abbreviation which would soon be
invalid was solved in different way than proposed by Linus. Instead
of increasing the default abbrev length for all projects, making abbrevs
longer and more unwieldy also for small projects that don't need it,
Peff [proposed](https://public-inbox.org/git/[email protected]/)
to make default abbrev length be dynamically based on the number of objects
in the repository. Linus sent [rough implementation](https://public-inbox.org/git/CA+55aFwbCNiF0nDppZ5SuRcZwc9kNvKYzgyd_bR8Ut8XRW_p4Q@mail.gmail.com/)
of this idea, which after a few iterations (and cleanups of related code)
got merged into 'next' as [bb188d00f7](https://github.com/git/git/commit/bb188d00f7).

* [Prepare the sequencer for the upcoming rebase -i patches](http://public-inbox.org/git/[email protected]/)

Johannes Schindelin, alias Dscho, is the maintainer of Git for
Expand Down