git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH 3/3] abbrev: auto size the default abbreviation
Date: Mon, 3 Oct 2016 15:34:03 -0700	[thread overview]
Message-ID: <CA+55aFydV+9c3-5C03XUj7v_wGJF5NyJNaP6742zLVgZs410FA@mail.gmail.com> (raw)
In-Reply-To: <20161003222701.za5njew33rqc5b6g@sigill.intra.peff.net>

On Mon, Oct 3, 2016 at 3:27 PM, Jeff King <peff@peff.net> wrote:
>
> +       if (len < 0) {
> +               unsigned long count = approximate_object_count();
> +               len = (msb(count) + 1) / 2;
> +               if (len < 0)
> +                       len = FALLBACK_DEFAULT_ABBREV;
> +       }

that second "if (len < 0)" should probably be testing against
FALLBACK_DEFAULT_ABBREV, not zero. Or at the very least
MINIMUM_ABBREV. Because a two-character abbreviation won't even be
recognized, even if the git project is very small indeed.

            Linus

  reply	other threads:[~2016-10-03 22:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-01  0:19 [PATCH 0/3] auto-sizing default abbreviation length Junio C Hamano
2016-10-01  0:19 ` [PATCH 1/3] abbrev: add FALLBACK_DEFAULT_ABBREV to prepare for auto sizing Junio C Hamano
2016-10-01  0:19 ` [PATCH 2/3] abbrev: prepare for new world order Junio C Hamano
2016-10-01  0:19 ` [PATCH 3/3] abbrev: auto size the default abbreviation Junio C Hamano
2016-10-03 22:27   ` Jeff King
2016-10-03 22:34     ` Linus Torvalds [this message]
2016-10-03 22:40       ` Jeff King
2016-10-03 22:52         ` Junio C Hamano
2016-10-03 23:47           ` Jeff King
2016-10-04  1:37             ` Junio C Hamano
2016-10-04 12:18               ` Jeff King
2016-11-02  1:33     ` Junio C Hamano
2016-11-02  2:12       ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+55aFydV+9c3-5C03XUj7v_wGJF5NyJNaP6742zLVgZs410FA@mail.gmail.com \
    --to=torvalds@linux-foundation.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).