Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Miklos Vajna <vmiklos@frugalware.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 3/3] builtin-branch: use strbuf in rename_branch()
Date: Tue, 18 Nov 2008 15:57:17 -0800	[thread overview]
Message-ID: <7vbpwcvb8i.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <225d83c1ead50340eed97c64fbb8995017bf1ca8.1226954771.git.vmiklos@frugalware.org> (Miklos Vajna's message of "Mon, 17 Nov 2008 21:48:37 +0100")

Miklos Vajna <vmiklos@frugalware.org> writes:

> In case the length of branch name is greather then PATH_MAX-11, we write
> to unallocated memory otherwise.

True for {old,new}section.

I'll apply three patches from you as-is.  Thanks.

Having said that,

> -	snprintf(logmsg, sizeof(logmsg), "Branch: renamed %s to %s",
> -		 oldref, newref);
> +	strbuf_addf(&logmsg, "Branch: renamed %s to %s",
> +		 oldref.buf, newref.buf);

I am wondering why nobody has complained until now, but shouldn't this be
oldname and newname?  

    Reflog message: Branch: renamed refs/heads/master to refs/heads/naster

does not feel right, even though it is perfectly understandable to people
who know the internal (i.e. branches are implemented as a ref in
refs/heads hierarchy).

Rewording of the above, if it is ever done, has to be a separate commit,
and it is a behaviour change (if some third-party tool is reading and
parsing the reflog we will break it) which I do not particularly think is
worth doing.

I am mentioning this only because I just noticed it (and do not want to do
the thinking myself ;-).

  reply	other threads:[~2008-11-18 23:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-17 20:48 [PATCH 0/3] builtin-branch: use strbuf Miklos Vajna
2008-11-17 20:48 ` [PATCH 1/3] builtin-branch: use strbuf in delete_branches() Miklos Vajna
2008-11-17 20:48 ` [PATCH 2/3] builtin-branch: use strbuf in fill_tracking_info() Miklos Vajna
2008-11-17 20:48 ` [PATCH 3/3] builtin-branch: use strbuf in rename_branch() Miklos Vajna
2008-11-18 23:57   ` Junio C Hamano [this message]
2008-11-19  1:11     ` Johannes Schindelin
2008-11-19 19:48       ` Lars Hjemli

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=7vbpwcvb8i.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=vmiklos@frugalware.org \
    /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