git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Date
Jul 18, 2012, 07:27 UTC
Message-ID
<1342596455-17046-7-git-send-email-martin.von.zweigbergk@gmail.com>
In-Reply-To
<1342596455-17046-6-git-send-email-martin.von.zweigbergk@gmail.com>

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.

(One could alternatively change it to 'git rev-list a..b', which would
be even simpler, if it wasn't for the fact that we already have the
revision range expression in a variable.)
---
 git-rebase--interactive.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 47beb58..cd5a2cc 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -836,8 +836,7 @@ then
 	# No cherry-pick because our first pass is to determine
 	# parents to rewrite and skipping dropped commits would
 	# prematurely end our probe
-	git rev-list $revisions --reverse --left-right --topo-order |
-	sed -n "s/^>//p" |
+	git rev-list $revisions --reverse --right-only --topo-order |
 	while read -r sha1
 	do
 		if test -z "$rebase_root"
-- 
1.7.11.1.104.ge7b44f1
Previous: Martin von ZweigbergkNext: Martin von Zweigbergk
Message 7 of 15 in “correctly calculate patches to rebase”
  1. 0/7 correctly calculate patches to rebaseMartin von Zweigbergk, Jul 18, 2012
  2. 1/7 git-rebase--am.sh: avoid special-casing --keep-emptyMartin von Zweigbergk, Jul 18, 2012
  3. 2/7 git-rebase--interactive.sh: extract function for adding "pick" lineMartin von Zweigbergk, Jul 18, 2012
  4. 3/7 git-rebase--interactive: group all $preserve_merges codeMartin von Zweigbergk, Jul 18, 2012
  5. 4/7 git-rebase--interactive.sh: look up subject in add_pick_lineMartin von Zweigbergk, Jul 18, 2012
  6. 5/7 rebase -p: use --cherry-mark for todo fileMartin von Zweigbergk, Jul 18, 2012
  7. 6/7 rebase -p: don't request --left-right only to ignore left sideMartin von Zweigbergk, Jul 18, 2012
  8. 7/7 rebase (without -p): correctly calculate patches to rebaseMartin von Zweigbergk, Jul 18, 2012
  9. Johannes SixtJul 20, 2012
  10. Martin von ZweigbergkJul 20, 2012
  11. Johannes SixtJul 20, 2012
  12. Martin von ZweigbergkJul 20, 2012
  13. Junio C HamanoJul 22, 2012
  14. Neil HormanJul 18, 2012
  15. Martin von ZweigbergkJul 18, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.