From: Jonathan Nieder <jrnieder@gmail.com>
To: Jared Hance <jaredhance@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v3 2/3] Add function per_branch_config.
Date: Tue, 8 Feb 2011 19:14:42 -0600 [thread overview]
Message-ID: <20110209011441.GA24346@elie> (raw)
In-Reply-To: <1297211028-14382-3-git-send-email-jaredhance@gmail.com>
Jared Hance wrote:
> [PATCH v3 2/3] Add function per_branch_config.
>
> Adds a configuration function to be filled up more in the next patch.
Micronit: subject should be of the form
subsystem: do something really great
with no full stop. So the series might be, roughly:
- merge: introduce setup_merge_commit helper function
- merge: introduce per-branch configuration helper function
- merge: add support for merging from upstream by default
Commit message bodies tend to be in the imperative mood, just like the
patches themselves.
Anyway, I like patch 1. One tiny nit on this one:
> +++ b/builtin/merge.c
> @@ -498,11 +498,15 @@ cleanup:
> strbuf_release(&bname);
> }
>
> -static int git_merge_config(const char *k, const char *v, void *cb)
> +static int per_branch_config(const char *k, const char *v, void *cb)
> {
> - if (branch && !prefixcmp(k, "branch.") &&
> - !prefixcmp(k + 7, branch) &&
> - !strcmp(k + 7 + strlen(branch), ".mergeoptions")) {
> + const char *variable;
> + if (!branch || prefixcmp(k, "branch.")
> + || prefixcmp(k + 7, branch))
> + return 1; /* not what I handle */
Alignment: isn't the "||" meant to be one space over?
Based on a quick grep[1], it seems the prevailing style is rather
if (!branch || prefixcmp(k, "branch.") ||
prefixcmp(k + 7, branch))
return 1;
with the || at the end of the line, though I'm not sure I care
much. :)
With or without an extra space before the ||,
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Thanks for a nice cleanup.
Jonathan
[1]
addup () {
sum=0
while read term
do
: $((sum = sum + term))
done
echo $sum
}
$ git grep --cached -c -e '||$' | cut -d: -f2 | addup
730
$ git grep --cached -c -e ' ||' | cut -d: -f2 | addup
98
$ git grep --cached -c -e ' ||' | cut -d: -f2 | addup
79
next prev parent reply other threads:[~2011-02-09 1:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-08 20:48 [PATCH v2] Add support for merging from upstream by default Jared Hance
2011-02-08 21:38 ` Jay Soffian
2011-02-08 22:33 ` Jonathan Nieder
2011-02-09 0:04 ` Junio C Hamano
2011-02-09 1:48 ` Jonathan Nieder
2011-02-09 0:23 ` [PATCH v3 0/3] Updated patch series for default upstream merge Jared Hance
2011-02-09 0:23 ` [PATCH v3 1/3] Add setup_merge_commit function to merge/builtin.c Jared Hance
2011-02-09 23:24 ` Junio C Hamano
2011-02-09 0:23 ` [PATCH v3 2/3] Add function per_branch_config Jared Hance
2011-02-09 1:14 ` Jonathan Nieder [this message]
2011-02-09 23:27 ` Junio C Hamano
2011-02-09 0:23 ` [PATCH v3 3/3] Add support for merging from upstream by default Jared Hance
2011-02-09 1:41 ` Jonathan Nieder
2011-02-09 0:34 ` [PATCH v3 0/3] Updated patch series for default upstream merge 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=20110209011441.GA24346@elie \
--to=jrnieder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jaredhance@gmail.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).