Re: [PATCH v2 04/13] Teach rebase interactive the mark command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Johannes Schindelin schrieb am Sun 04. May, 10:38 (+0100):
> 	pick 1234567 Clean up rebase -i -p
> 	tag cleanup
> 	...
> 	merge 2345678 cleanup master
> 
> Yes, you read that correctly, I think that allowing plain ref names is 
> very valuable.  AFAICT my original implementation allows that (dunno about 
> the current code).

Your code is still used and you can do things like:

merge abc --strategy=YOUR_STRATEGY master 022ef38 my_tag

And I think it's really easy to do a git-describe for each ref that is not
marked of reset and merge commands

From fec670a4dc6fdf484a197687db5fbd0a4f668449 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?J=C3=B6rg=20Sommer?= <joerg@xxxxxxxxxxxx>
Date: Sun, 4 May 2008 14:52:01 +0200
Subject: [PATCH] Use names instead of sha1 ID for reset and merge if possible
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Sometimes it's much more helpful to see the name of a branch or a tag as
the argument of a merge or reset command.

Signed-off-by: Jörg Sommer <joerg@xxxxxxxxxxxx>
---
 git-rebase--interactive.sh |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 2a01182..2bd858c 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -493,6 +493,10 @@ create_extended_todo_list () {
 			if tmp=$(get_value_from_list $args "$commit_mark_list")
 			then
 				args=":$tmp"
+			elif tmp=$(git describe --all --exact-match $args \
+				2>/dev/null)
+			then
+				args="$tmp"
 			fi
 			;;
 		merge)
@@ -503,6 +507,10 @@ create_extended_todo_list () {
 					"$commit_mark_list")
 				then
 					new_args="$new_args :$tmp"
+				elif tmp=$(git describe --all --exact-match \
+					$i 2>/dev/null)
+				then
+					new_args="$new_args $tmp"
 				else
 					new_args="$new_args $i"
 				fi
-- 
1.5.5.1

Bye, Jörg.
-- 
Diskutiere nie mit einem Idioten:
Sie ziehen Dich auf ihr Niveau herab und schlagen Dich dann mit
Erfahrung.

Attachment: signature.asc
Description: Digital signature http://en.wikipedia.org/wiki/OpenPGP


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux