diff mbox series

doc: fix the max number of git show-branches shown

Message ID pull.1757.git.1720046185710.gitgitgadget@gmail.com (mailing list archive)
State Superseded
Headers show
Series doc: fix the max number of git show-branches shown | expand

Commit Message

Rikita Ishikawa July 3, 2024, 10:36 p.m. UTC
From: wonda-tea-coffee <lagrange.resolvent@gmail.com>

Contrary to the number listed in the current document,
only 26 are actually shown.

Signed-off-by: wonda-tea-coffee <lagrange.resolvent@gmail.com>
---
    doc: fix the max number of git show-branches shown

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1757%2Fwonda-tea-coffee%2Fupdate-git-show-branch-description-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1757/wonda-tea-coffee/update-git-show-branch-description-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1757

 Documentation/git-show-branch.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 06e570c0dfb2a2deb64d217db78e2ec21672f558

Comments

Jeff King July 6, 2024, 6:27 a.m. UTC | #1
On Wed, Jul 03, 2024 at 10:36:25PM +0000, wonda-tea-coffee via GitGitGadget wrote:

> From: wonda-tea-coffee <lagrange.resolvent@gmail.com>
> 
> Contrary to the number listed in the current document,
> only 26 are actually shown.

The commit message would be a good place to explain how we know "26" is
the right number. ;)

It looks like this is computed at build-time based on FLAG_BITS:

  #define REV_SHIFT        2
  #define MAX_REVS        (FLAG_BITS - REV_SHIFT) /* should not exceed bits_per_int - REV_SHIFT */

That's defined in object.h. Looking at "git log -GFLAG_BITS object.h",
it seems it was 27, then 29, and now 28. So I'm not sure how it was ever
29, but 26 makes sense now.

It is unfortunate that it _could_ change again without us realizing the
documentation is now stale. But I don't think it's something we'd touch
very often, so this is probably OK in practice (and as the TODO above
those lines says, ultimately this should use a commit-slab to handle an
arbitrary number of refs).

> Signed-off-by: wonda-tea-coffee <lagrange.resolvent@gmail.com>

We generally want a real name here, since this is certifying that you
agree to the DCO. See:

  https://git-scm.com/docs/SubmittingPatches#sign-off

-Peff
Junio C Hamano July 6, 2024, 6:21 p.m. UTC | #2
Jeff King <peff@peff.net> writes:

> It looks like this is computed at build-time based on FLAG_BITS:
>
>   #define REV_SHIFT        2
>   #define MAX_REVS        (FLAG_BITS - REV_SHIFT) /* should not exceed bits_per_int - REV_SHIFT */
>
> That's defined in object.h. Looking at "git log -GFLAG_BITS object.h",
> it seems it was 27, then 29, and now 28. So I'm not sure how it was ever
> 29, but 26 makes sense now.

Originally it was bits-per-word minus REV_SHIFT -- back then we
didn't even have FLAG_BITS.

> It is unfortunate that it _could_ change again without us realizing the
> documentation is now stale. But I don't think it's something we'd touch
> very often, so this is probably OK in practice (and as the TODO above
> those lines says, ultimately this should use a commit-slab to handle an
> arbitrary number of refs).

Yup, I was hoping I can craft a response that tricks somebody
(preferrably those who are not too experienced, as it should be too
easy for some of the experienced ones) into tackling that TODO item,
but you responded before I did ;-).

>> Signed-off-by: wonda-tea-coffee <lagrange.resolvent@gmail.com>
>
> We generally want a real name here, since this is certifying that you
> agree to the DCO. See:
>
>   https://git-scm.com/docs/SubmittingPatches#sign-off

Another rule is that the name used to sign-off and the name of the
author of the patch on "From: " line must match.

Thanks.  I was getting tired of the only person to point it out to
new contributors.
diff mbox series

Patch

diff --git a/Documentation/git-show-branch.txt b/Documentation/git-show-branch.txt
index c771c897707..bc31d8b6d33 100644
--- a/Documentation/git-show-branch.txt
+++ b/Documentation/git-show-branch.txt
@@ -22,7 +22,7 @@  Shows the commit ancestry graph starting from the commits named
 with <rev>s or <glob>s (or all refs under refs/heads
 and/or refs/tags) semi-visually.
 
-It cannot show more than 29 branches and commits at a time.
+It cannot show more than 26 branches and commits at a time.
 
 It uses `showbranch.default` multi-valued configuration items if
 no <rev> or <glob> is given on the command line.