From: Jeff King <peff@peff.net>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: "SZEDER Gábor" <szeder@ira.uka.de>,
"Christian Couder" <christian.couder@gmail.com>,
"Christian Couder" <chriscool@tuxfamily.org>,
git@vger.kernel.org, "Jonathan Nieder" <jrnieder@gmail.com>
Subject: Re: [BUG] multi-commit cherry-pick messes up the order of commits
Date: Thu, 12 Jan 2012 12:15:36 -0500 [thread overview]
Message-ID: <20120112171536.GA18102@sigill.intra.peff.net> (raw)
In-Reply-To: <CALkWK0=Mv_tzNw-hN_9fAr+vABappndEK5iSWQHDk8Yk6Z-stw@mail.gmail.com>
On Thu, Jan 12, 2012 at 10:39:48PM +0530, Ramkumar Ramachandra wrote:
> Jeff King wrote:
> > I agree it would be nice to make:
> > git cherry-pick commit1 commit3 commit2
> >
> > work in the order specified, but how does that interact with existing
> > cases that provide more traditional revision arguments?
>
> What are your thoughts on making it a flag in the revision API to be
> activated with "cherry-pick --literal-order commit1 commit3 commit2"
> or similar? I'm not sure how to get it to reconcile with the more
> traditional revision arguments yet. My current worktree (WIP):
I think that is a sensible first-cut. It may even be possible to use
heuristics to identify when --literal-order is needed, and eventually it
could go away. But that is a much riskier feature that can be built on
top of the much safer proposal you are making.
> diff --git a/revision.c b/revision.c
> index 064e351..301ef58 100644
> --- a/revision.c
> +++ b/revision.c
> @@ -2054,7 +2054,10 @@ int prepare_revision_walk(struct rev_info *revs)
> if (commit) {
> if (!(commit->object.flags & SEEN)) {
> commit->object.flags |= SEEN;
> - commit_list_insert_by_date(commit,
> &revs->commits
> + if (revs->literal_order)
> + commit_list_insert(commit,
> &revs->commits
> + else
> +
> commit_list_insert_by_date(commit, &revs-
My only concern is that there are other parts of the revision machinery
that depend on the date-ordering of the commit list. What would happen,
for example, with:
git rev-list --literal-order --do-walk foo
It probably doesn't make sense to allow literal-order without no-walk,
anyway (which of course is the default in cherry-pick anyway, so it's
not a big deal here).
I'm also not sure what:
git rev-list --literal-order foo..bar
would or should do.
-Peff
next prev parent reply other threads:[~2012-01-12 17:15 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-11 17:31 [BUG] multi-commit cherry-pick messes up the order of commits SZEDER Gábor
2012-01-12 13:31 ` Christian Couder
2012-01-12 14:44 ` SZEDER Gábor
2012-01-12 16:35 ` Ramkumar Ramachandra
2012-01-12 16:53 ` Jeff King
2012-01-12 17:09 ` Ramkumar Ramachandra
2012-01-12 17:14 ` Ramkumar Ramachandra
2012-01-12 17:15 ` Jeff King [this message]
2012-01-12 17:26 ` Ramkumar Ramachandra
2012-01-12 17:50 ` [PATCH] cherry-pick: add failing test for out-of-order pick Ramkumar Ramachandra
2012-01-12 18:32 ` Jonathan Nieder
2012-01-12 19:05 ` [PATCH v2] " Ramkumar Ramachandra
2012-01-12 19:33 ` Jonathan Nieder
2012-01-12 18:25 ` [BUG] multi-commit cherry-pick messes up the order of commits Junio C Hamano
2012-01-12 19:25 ` Ramkumar Ramachandra
2012-01-12 19:47 ` Jeff King
2012-01-12 20:11 ` Jonathan Nieder
2012-01-12 20:17 ` Jeff King
2012-01-12 20:11 ` Junio C Hamano
2012-01-12 19:21 ` Johannes Sixt
2012-01-12 19:29 ` Ramkumar Ramachandra
2012-01-12 19:34 ` Jonathan Nieder
2012-01-12 17:47 ` Jonathan Nieder
2012-01-12 18:41 ` 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=20120112171536.GA18102@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=artagnon@gmail.com \
--cc=chriscool@tuxfamily.org \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=jrnieder@gmail.com \
--cc=szeder@ira.uka.de \
/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).