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

[PATCH RFC 3/4] rebase -i: Add the "ref" command

From
Greg Price <price@ksplice.com>
Date
Dec 22, 2009, 22:22 UTC
Message-ID
<20091222222256.GX30538@dr-wily.mit.edu>
In-Reply-To
<20091222222032.GU30538@dr-wily.mit.edu>

This is useful for, e.g., rewriting a branch that has ancestor branches along the way.

Signed-off-by: Greg Price <price@ksplice.com>
---
 git-rebase--interactive.sh |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 0bd3bf7..25ac3e3 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -367,6 +367,10 @@ do_next () {
 		warn
 		exit 0
 		;;
+	ref)
+		mark_action_done
+		git update-ref $sha1 HEAD # $sha1 is actually a refname
+		;;
 	squash|s)
 		comment_for_reflog squash
 
-- 
1.6.6.rc1.9.g2ad41.dirty
Previous: Greg PriceNext: Greg Price
Message 4 of 11 in “rebase -i: Add --refs option to rewrite heads within branch”
  1. 0/4 rebase -i: Add --refs option to rewrite heads within branchGreg Price, Dec 22, 2009
  2. 1/4 pretty: Add %D for script-friendly decorationGreg Price, Dec 22, 2009
  3. 2/4 log --decorate=full: drop the "tag: " prefixGreg Price, Dec 22, 2009
  4. 3/4 rebase -i: Add the "ref" commandGreg Price, Dec 22, 2009
  5. 4/4 rebase -i: add --refs option to rewrite heads within branchGreg Price, Dec 22, 2009
  6. Junio C HamanoDec 22, 2009
  7. Greg PriceDec 23, 2009
  8. Michael J GruberDec 23, 2009
  9. Greg PriceDec 23, 2009
  10. Junio C HamanoDec 23, 2009
  11. Johannes SchindelinDec 23, 2009

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.