From: Paolo Bonzini <paolo.bonzini@lu.unisi.ch>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Paolo Bonzini <bonzini@gnu.org>, git@vger.kernel.org
Subject: Re: [PATCH 1/3] git-branch: add --track and --no-track options
Date: Mon, 05 Mar 2007 16:22:26 +0100 [thread overview]
Message-ID: <45EC35B2.2070808@lu.unisi.ch> (raw)
In-Reply-To: <Pine.LNX.4.63.0703051520340.22628@wbgn013.biozentrum.uni-wuerzburg.de>
>> + /* Try an exact match first. */
>> + sscanf(value, "refs/%*[^:]:%n", &len_first);
>
> This is the first time I saw that sscanf format type. How portable is it?
It is. At the very least it is in OpenGroup.
>> + /* Truncate the value before the colon. */
>> + asprintf(&config_repo, "%.*s", len_first - 1, value);
>
> asprintf() is a GNU extension. I guess it is better to just
>
> config_repo = xstrdup(value);
> config_repo[p - value] = '\0';
git has nfvasprintf -- I'll just use that one.
> FWIW I don't think .trackIntoLocalBranches" is needed. Opinions?
That's because I'd like to make it the default for me... Also, look at patch 3/3.
>> @@ -333,7 +424,9 @@ static void create_branch(const char *name, const char *start_name,
>> if (start_sha1)
>> /* detached HEAD */
>> hashcpy(sha1, start_sha1);
>> - else if (get_sha1(start_name, sha1))
>> + else if (dwim_ref(start_name, strlen(start_name), sha1, &real_ref) > 1)
>> + die("Ambiguous object name: '%s'.", start_name);
>
> I know, I should have said that earlier, but I just found out myself: We
> have a config variable core.warnambiguousrefs, and maybe we should _not_
> complain and set the defaults when the global variable warn_ambiguous_refs
> is 0.
If warn_ambiguous_ref == 0, dwim_ref is never going to answer anything > 1...
Paolo
next prev parent reply other threads:[~2007-03-05 15:22 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-05 8:57 [PATCH 1/3] git-branch: add --track and --no-track options Paolo Bonzini
2007-03-05 14:50 ` Johannes Schindelin
2007-03-05 15:22 ` Paolo Bonzini [this message]
2007-03-05 16:09 ` Johannes Schindelin
2007-03-05 17:22 ` Paolo Bonzini
2007-03-05 15:36 ` Paolo Bonzini
2007-03-05 15:58 ` Johannes Schindelin
2007-03-05 16:54 ` Paolo Bonzini
2007-03-05 17:16 ` Johannes Schindelin
2007-03-05 17:22 ` Paolo Bonzini
2007-03-05 18:37 ` Johannes Schindelin
2007-03-05 21:19 ` Paolo Bonzini
2007-03-05 21:27 ` Junio C Hamano
2007-03-06 7:23 ` Paolo Bonzini
2007-03-05 23:09 ` Johannes Schindelin
2007-03-06 6:45 ` Junio C Hamano
2007-03-06 7:26 ` Paolo Bonzini
2007-03-06 7:40 ` Junio C Hamano
2007-03-06 7:48 ` Paolo Bonzini
2007-03-06 8:22 ` Junio C Hamano
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=45EC35B2.2070808@lu.unisi.ch \
--to=paolo.bonzini@lu.unisi.ch \
--cc=Johannes.Schindelin@gmx.de \
--cc=bonzini@gnu.org \
--cc=git@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.