From: Jonathan Nieder <jrnieder@gmail.com>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: "Guido Günther" <agx@sigxcpu.org>, git@vger.kernel.org
Subject: Re: [PATCH] revert.c: Allow to specify -x via git-config
Date: Tue, 18 Feb 2014 11:20:39 -0800 [thread overview]
Message-ID: <20140218192039.GC7855@google.com> (raw)
In-Reply-To: <20140218183842.GA163138@vauxhall.crustytoothpaste.net>
brian m. carlson wrote:
> I can provide a use case. At work, we merge into the maintenance and
> development branches and cherry-pick from the maintenance to the stable
> branches. We want committers to always use -x -s because we need to
> know which reviewer backported the change and we want to be able to
> track which commits have been backported and whether any reverts also
> need to be cherry-picked. We also have automated tools that want this
> information.
>
> I usually solve this with an alias (backport = cherry-pick -x -s), but I
> can see how this might be a useful option.
Thanks for the example.
Here the alias seems like a nicer solution than a configuration
changing the default behavior of "git cherry-pick" because
(1) it is easy to temporarily turn the effect off, by using cherry-pick
directly instead of using the alias
(2) it doesn't affect scripts that use cherry-pick
(3) The caller explicitly specifies their intent by running "git
backport". It doesn't affect unrelated uses of cherry-pick on
other branches.
(4) it can be set up globally and takes effect when appropriate
without needing any special setup per repository
(5) it also implements the other part of your backporting policy (-s)
and if in the future you had more backporting rules (e.g., requirement
to specify which commit introduced the regression that this backport
solves) then it could be easily tweaked
All that said, I wouldn't mind some magic that changes the default
behavior of "git cherry-pick" as long as (1), (2), and (3) are
resolved somehow. E.g.
(i) a working --no-record-origin option that overrides this config
(ii) a --porcelain or similar option or just better documentation
about how scripts can protect themselves from further changes
to 'git cherry-pick' behavior
(iii) config applying per destination branch instead of globally
Hope that helps,
Jonathan
next prev parent reply other threads:[~2014-02-18 19:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-18 6:56 [PATCH] revert.c: Allow to specify -x via git-config Guido Günther
2014-02-18 9:11 ` John Keeping
2014-02-18 17:49 ` Jonathan Nieder
2014-02-18 18:38 ` brian m. carlson
2014-02-18 19:20 ` Jonathan Nieder [this message]
2014-02-18 21:27 ` [PATCH v2 0/3] Allow to configure cherry-pick's record origin Guido Günther
2014-02-18 21:27 ` [PATCH v2 1/3] revert.c: Allow to specify -x via git-config Guido Günther
2014-02-19 19:57 ` Junio C Hamano
2014-02-18 21:27 ` [PATCH v2 2/3] revert.c: Add --record-origin Guido Günther
2014-02-18 21:27 ` [PATCH v2 3/3] revert.c Allow to override cherrypick.recordOrigin Guido Günther
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=20140218192039.GC7855@google.com \
--to=jrnieder@gmail.com \
--cc=agx@sigxcpu.org \
--cc=git@vger.kernel.org \
--cc=sandals@crustytoothpaste.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.
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).