Re: [PATCH 4/7] git-rebase--interactive.sh: look up subject in add_pick_line

2012-07-20 Thread Martin von Zweigbergk
Thanks for reviewing. On Fri, Jul 20, 2012 at 1:14 AM, Johannes Sixt wrote: > Am 7/18/2012 9:27, schrieb Martin von Zweigbergk: >> @@ -814,7 +814,8 @@ add_pick_line () { >> else >> comment_out= >> fi >> - printf '%s\

[PATCH 1/7] git-rebase--am.sh: avoid special-casing --keep-empty

2012-07-18 Thread Martin von Zweigbergk
Since 0fbb95d (am: don't call mailinfo if $rebasing, 2012-06-26), the patch body to apply when running 'git am --rebasing' is not taken from the mbox, but directly from the commit. If such a commit is "empty", 'git am --rebasing' still happily applies it and commits. However, since the input to 'gi

Re: [PATCH 0/7] correctly calculate patches to rebase

2012-07-18 Thread Martin von Zweigbergk
Argh! Sorry about the sendemail.chainreplyto=true. I must have read that warning message incorrectly :-(. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 7/7] rebase (without -p): correctly calculate patches to rebase

2012-07-18 Thread Martin von Zweigbergk
erry' and filter for lines starting with '+'. This works for all but 'rebase -p', since 'git cherry' ignores merges. As a side-effect, we also avoid the cost of formatting patches. Test case updates for 'rebase -m' by Knut, the rest by Martin.

[PATCH 0/7] correctly calculate patches to rebase

2012-07-18 Thread Martin von Zweigbergk
These seven patches replace the broken one I sent in http://thread.gmane.org/gmane.comp.version-control.git/200644/focus=200648. I hope I got the handling of empty commits right this time. Martin von Zweigbergk (7): git-rebase--am.sh: avoid special-casing --keep-empty git-rebase

[PATCH 4/7] git-rebase--interactive.sh: look up subject in add_pick_line

2012-07-18 Thread Martin von Zweigbergk
The todo file is generated using (more-or-less) 'git rev-list $revisions --pretty=oneline --abbrev-commit --abbrev=7', i.e. by letting 'git rev-list' output both the abbreviated sha1 and the subject line. To allow us to more easily generate the list of commits to rebase by using commands that don't

[PATCH 6/7] rebase -p: don't request --left-right only to ignore left side

2012-07-18 Thread Martin von Zweigbergk
While generating the todo file, rebase -p calls 'git rev-list --left-right a...b' (with 'a' equal to $upstream or $onto and 'b' equal to $orig_head) and its output is piped through 'sed -n "s/^>//p"', making it equivalent to 'git rev-list --right-only a...b'. Change the invocation to exactly that.

[PATCH 5/7] rebase -p: use --cherry-mark for todo file

2012-07-18 Thread Martin von Zweigbergk
While building the todo file, 'rebase -p' needs to find the cherry-picked commits in the branch that is about to be rebased. For this, it calculates the set difference between the full set of commits and the non-cherry-picked ones (as reported by 'git rev-list --left-right --cherry-pick'). Now that

[PATCH 2/7] git-rebase--interactive.sh: extract function for adding "pick" line

2012-07-18 Thread Martin von Zweigbergk
Extract the code that adds a possibly commented-out "pick" line to the todo file. This lets us reuse it more easily later. --- git-rebase--interactive.sh | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.

[PATCH 3/7] git-rebase--interactive: group all $preserve_merges code

2012-07-18 Thread Martin von Zweigbergk
The code in git-rebase--interactive that creates the todo file contains if-blocks that depend on whether $preserve_merges is active. There is only a very small amount of code in between that is shared with non-merge-preserving code path, so remove the repeated conditions and duplicate the small amo

Re: [PATCH v8 4/4] git-rebase: add keep_empty flag

2012-07-18 Thread Martin von Zweigbergk
On Wed, Jul 18, 2012 at 12:10 AM, Johannes Sixt wrote: > Am 7/18/2012 8:20, schrieb Martin von Zweigbergk: >> On Fri, Apr 20, 2012 at 7:36 AM, Neil Horman wrote: >>> pick_one () { >>> ff=--ff >>> + >>> case "$1" in

Re: [PATCH v8 4/4] git-rebase: add keep_empty flag

2012-07-17 Thread Martin von Zweigbergk
On Fri, Apr 20, 2012 at 7:36 AM, Neil Horman wrote: > pick_one () { > ff=--ff > + > case "$1" in -n) sha1=$2; ff= ;; *) sha1=$1 ;; esac > case "$force_rebase" in '') ;; ?*) ff= ;; esac > output git rev-parse --verify $sha1 || die "Invalid commit name: > $sha1" > +

<    1   2   3