From: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>,
Francis Moreau <francis.moro@gmail.com>,
Michael J Gruber <git@drmicha.warpmail.net>,
git@vger.kernel.org, Ramkumar Ramachandra <artagnon@gmail.com>
Subject: Re: git-rebase skips automatically no more needed commits
Date: Tue, 20 Sep 2011 16:45:40 -0400 (EDT) [thread overview]
Message-ID: <alpine.DEB.2.00.1109201254020.12564@debian> (raw)
In-Reply-To: <alpine.DEB.2.00.1109151956040.12564@debian>
On Thu, 15 Sep 2011, Martin von Zweigbergk wrote:
[CC'ing Ramkunar regarding the footnote]
> [...] With your
> patch, we would also get the patch body from the commit. The only
> thing remaining after that is the commit log message, correct?
It turns out the commit log message have been taken from the commit
for ages. Sorry about not checking the code first.
I have started implementing the changes to git-am.sh now. I have made
it not use mailinfo when in $rebasing mode, as you suggested. So now
git-am works even if only a list of
From $sha1 Mon Sep 17 00:00:00 2001
lines are fed to it. Since only the $sha1 is needed, we should
probably make --rebasing imply a patch-format is just a simple list of
revisions. Since the --rebasing flag is only for internal use, this
should be safe when it comes to backwards compatibility. [1]
Now the question is how to generate such lines, without the overhead
of a full format-patch call. We still want the --ignore-if-in-upstream
functionality, so we can not use plain rev-list. We also want it to
work with --root, so we can not use git-cherry. Finally, we can not
use 'git rev-list --cherry-pick --right-only' since it seems to be
inherently for symmetric ranges and therefore does not support
git-cherry's <limit> parameter.
If I'm not mistaken, we would have to teach some new option to some
command, but which one?
It doesn't feel right to teach format-patch a --commit-name-only,
simply because it would then no longer be a patch.
It's probably easiest to teach git-cherry a --root flag. Does that
sound like the right solution to people? I think it makes sense for
such an option to exist.
More involved would be to teach rev-list --cherry-pick also for
asymmetric ranges. I would imagine that "--cherry-pick $branch --not
$newbase $oldbase" could be defined as "all commits in $branch that
are not patch-equivalent to any commits in $newbase or $oldbase". Just
s/patch-equivalent/identical/ and you have the regular definition of
the rev-list, right? There is of course no need to actually calculate
the patch-id for any commits are not in "$branch --not $newbase
$oldbase" (identical => patch-equivalent).
I would go for teaching git-cherry --root, unless the "rev-list
--cherry-pick for asymmetric ranges" option would be useful
elsewhere. Either way, teaching git-cherry --root would not be a bad
thing, I think.
Martin
[1] Long term, would it make sense to teach 'git cherry-pick' a '-2'
option instead of using the '-3' option to 'git am'? (Where 'git
cherry-pick -2' would try "apply && write-tree && commit-tree"
before falling back to merging.)
next prev parent reply other threads:[~2011-09-20 20:45 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-06 16:08 git-rebase skips automatically no more needed commits Francis Moreau
2011-09-06 17:09 ` Junio C Hamano
2011-09-06 19:28 ` Francis Moreau
2011-09-07 13:19 ` Michael J Gruber
[not found] ` <CAC9WiBi_bkLNJZckq2fr3eb6ie+KVfauE_PyA3GcaW5Ga-isFw@mail.gmail.com>
2011-09-07 16:29 ` Junio C Hamano
2011-09-08 7:10 ` Francis Moreau
2011-09-08 13:14 ` Martin von Zweigbergk
[not found] ` <CAC9WiBiMYUfaPtrXyW=W7qaZnJqLeFO-B3od7X4u8wUrb8hfUA@mail.gmail.com>
2011-09-09 2:23 ` Martin von Zweigbergk
2011-09-09 6:43 ` Francis Moreau
2011-09-09 13:06 ` Martin von Zweigbergk
2011-09-09 13:25 ` Francis Moreau
2011-09-15 2:19 ` Martin von Zweigbergk
2011-09-15 3:41 ` Junio C Hamano
2011-09-16 1:27 ` Martin von Zweigbergk
2011-09-20 20:45 ` Martin von Zweigbergk [this message]
2011-09-24 9:12 ` Ramkumar Ramachandra
2011-09-25 3:25 ` Martin von Zweigbergk
2011-09-26 9:10 ` Thomas Rast
2011-09-28 14:49 ` Martin von Zweigbergk
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=alpine.DEB.2.00.1109201254020.12564@debian \
--to=martin.von.zweigbergk@gmail.com \
--cc=artagnon@gmail.com \
--cc=francis.moro@gmail.com \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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