Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add "tg base" that prints the base version.

Signed-off-by: Per Cederqvist <ceder@lysator.liu.se>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
  • Loading branch information...
commit 913035b61e5ee1a583ff45014154e383a56c3292 1 parent a5d6964
Per Cederqvist authored August 24, 2010 Uwe Kleine-König committed August 24, 2010
2  .gitignore
@@ -12,6 +12,8 @@
12 12
 
13 13
 /hooks/pre-commit
14 14
 /tg
  15
+/tg-base
  16
+/tg-base.txt
15 17
 /tg-create
16 18
 /tg-create.txt
17 19
 /tg-delete
15  README
@@ -508,6 +508,21 @@ tg push
508 508
 	repository.  By default the remote gets all dependencies
509 509
 	(both tgish and non-tgish) and bases pushed to.
510 510
 
  511
+tg base
  512
+~~~~~~~
  513
+	Prints the base commit of the current topic branch.  Silently
  514
+	exits with exit code 1 if you are not working on a TopGit
  515
+	branch.  The following command can be useful to get a summary
  516
+	of the work you have made on a topic branch:
  517
+
  518
+		git log --first-parent --no-merges `tg base`..
  519
+
  520
+	(Note: if you have shared the TopGit branch, the above command
  521
+	only lists the commits that were made in the current
  522
+	repository, so you will not see work done by your
  523
+	collaborators.)
  524
+
  525
+
511 526
 TODO: tg rename
512 527
 
513 528
 
9  tg-base.sh
... ...
@@ -0,0 +1,9 @@
  1
+#!/bin/sh
  2
+# TopGit - A different patch queue manager
  3
+# (c) Petr Baudis <pasky@suse.cz>  2008
  4
+# (c) Per Cederqvist <ceder@lysator.liu.se>  2010
  5
+# GPLv2
  6
+
  7
+name="$(git symbolic-ref HEAD | sed 's#^refs/\(heads\|top-bases\)/##')"
  8
+base_rev="$(git rev-parse --short --verify "refs/top-bases/$name" 2>/dev/null)" || exit 1
  9
+echo $base_rev

0 notes on commit 913035b

Please sign in to comment.
Something went wrong with that request. Please try again.