From: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>
To: kusmabite@gmail.com
Cc: Erik Faye-Lund <kusmabite@googlemail.com>, git@vger.kernel.org
Subject: Re: [PATCH RFC] cherry: support --abbrev option
Date: Tue, 16 Mar 2010 00:16:59 +0100 [thread overview]
Message-ID: <4B9EBFEB.5070108@lsrfire.ath.cx> (raw)
In-Reply-To: <40aa078e1003151530y19f10bf1l852a0e5230b11cb6@mail.gmail.com>
Am 15.03.2010 23:30, schrieb Erik Faye-Lund:
> On Mon, Mar 15, 2010 at 6:08 PM, René Scharfe
>> If I use --no-abbrev, do I get 0 or 40 hash chars? I didn't actually
>> test it, but I suspect an "if (!abbrev) abbrev = 40;" is needed somewhere.
>
> "abbrev" is initialized to 40 when declared, so you get the same
> behavior as before by default.
Yes, but --no-abbrev sets it to zero. Which is OK, though, as I found
out after actually testing your patch this time. A closer look at
find_unique_abbrev() in sha1_name.c reveals that the function returns
the full hash if len is either 40 or 0.
So you could initialize abbrev to zero and avoid the magic constant 40
there altogether. (Is this still nitpicking or already bikeshedding? ;)
René
next prev parent reply other threads:[~2010-03-15 23:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-15 16:03 [PATCH RFC] cherry: support --abbrev option Erik Faye-Lund
2010-03-15 17:08 ` René Scharfe
2010-03-15 22:30 ` Erik Faye-Lund
2010-03-15 23:16 ` René Scharfe [this message]
2010-03-15 23:50 ` Erik Faye-Lund
2010-03-16 0:46 ` René Scharfe
2010-03-16 0:59 ` Erik Faye-Lund
2010-03-16 1:44 ` Junio C Hamano
2010-03-15 17:13 ` Junio C Hamano
2010-03-15 22:39 ` Erik Faye-Lund
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B9EBFEB.5070108@lsrfire.ath.cx \
--to=rene.scharfe@lsrfire.ath.cx \
--cc=git@vger.kernel.org \
--cc=kusmabite@gmail.com \
--cc=kusmabite@googlemail.com \
/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.
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 NNTP newsgroup(s).