git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH guilt] Handles slashes in branch names
@ 2007-07-19 18:35 Eric Lesh
  2007-07-19 18:44 ` Josef Sipek
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Lesh @ 2007-07-19 18:35 UTC (permalink / raw)
  To: Joseph Jeff Sipek; +Cc: Git mailing list

When a branch name has a slash and autotagging is enabled, guilt barfs
when updating the stack tags.  Escape the branch name in the tags to
allow this to work.

Also allow guilt to create the patches directory for these branches.

Signed-off-by: Eric Lesh <eclesh@ucla.edu>
---
 guilt      |   15 +++++++++------
 guilt-init |    2 +-
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/guilt b/guilt
index 214def4..9e4789a 100755
--- a/guilt
+++ b/guilt
@@ -334,20 +334,23 @@ update_stack_tags()
 		return 0
 	fi
 
+        # handle branches with slashes
+        newbranch=`echo $branch | sed -e 's,\/,-,'`
+
 	if [ `wc -l < $applied` -gt 0 ]; then
 		# there are patches applied, therefore we must get the top,
 		# bottom and base hashes, and update the tags
 
-		git-rev-parse HEAD > "$GIT_DIR/refs/tags/${branch}_top"
-		head -1 < $applied | cut -d: -f1 > "$GIT_DIR/refs/tags/${branch}_bottom"
-		git-rev-parse $(head -1 < $applied | cut -d: -f1)^ > "$GIT_DIR/refs/tags/${branch}_base"
+		git-rev-parse HEAD > "$GIT_DIR/refs/tags/${newbranch}_top"
+		head -1 < $applied | cut -d: -f1 > "$GIT_DIR/refs/tags/${newbranch}_bottom"
+		git-rev-parse $(head -1 < $applied | cut -d: -f1)^ > "$GIT_DIR/refs/tags/${newbranch}_base"
 	else
 		# there are no patches applied, therefore we must remove the
 		# tags to old top, bottom, and base
 
-		rm -f "$GIT_DIR/refs/tags/${branch}_top"
-		rm -f "$GIT_DIR/refs/tags/${branch}_bottom"
-		rm -f "$GIT_DIR/refs/tags/${branch}_base"
+		rm -f "$GIT_DIR/refs/tags/${newbranch}_top"
+		rm -f "$GIT_DIR/refs/tags/${newbranch}_bottom"
+		rm -f "$GIT_DIR/refs/tags/${newbranch}_base"
 	fi
 }
 
diff --git a/guilt-init b/guilt-init
index ffe2434..9136f89 100755
--- a/guilt-init
+++ b/guilt-init
@@ -24,7 +24,7 @@ if [ -d "$GUILT_DIR/$branch" ]; then
 fi
 
 [ ! -d "$GUILT_DIR" ] && mkdir $GUILT_DIR
-mkdir $GUILT_DIR/$branch
+mkdir -p $GUILT_DIR/$branch
 touch $GUILT_DIR/$branch/series
 touch $GUILT_DIR/$branch/status
 
-- 
1.5.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-07-19 19:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-19 18:35 [PATCH guilt] Handles slashes in branch names Eric Lesh
2007-07-19 18:44 ` Josef Sipek
2007-07-19 19:17   ` Eric Lesh
2007-07-19 19:35     ` Josef Sipek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).