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

[TopGit PATCH 05/10] list_deps: accept -i/-w

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
Oct 8, 2010, 07:58 UTC
Message-ID
<724f5482452ad11bd3fb8560bacb080fa1cef0a4.1286524446.git.bert.wesarg@googlemail.com>
In-Reply-To
<c013d1489409b5d6e76764aba07eca7107715691.1286524446.git.bert.wesarg@googlemail.com>
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 tg.sh |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/tg.sh b/tg.sh
index a166a70..72ee9f5 100644 tg.sh
--- a/tg.sh
+++ b/tg.sh
@@ -289,9 +289,13 @@ branch_empty()
 	[ "$(pretty_tree "$1" -b)" = "$(pretty_tree "$1" ${2-})" ]
 }
 
-# list_deps
+# list_deps [-i | -w]
+# -i/-w apply only to HEAD
 list_deps()
 {
+	head="$(git symbolic-ref HEAD)"
+	head="${head#refs/heads/}"
+
 	git for-each-ref refs/top-bases |
 		while read rev type ref; do
 			name="${ref#refs/top-bases/}"
@@ -299,7 +303,10 @@ list_deps()
 				continue;
 			fi
 
-			git cat-file blob "$name:.topdeps" | while read dep; do
+			from=$head_from
+			[ "$name" = "$head" ] ||
+				from=
+			cat_file "$name:.topdeps" $from | while read dep; do
 				dep_is_tgish=true
 				ref_exists "refs/top-bases/$dep"  ||
 					dep_is_tgish=false
-- 
1.7.1.1067.g5aeb7
Previous: Bert WesargNext: Bert Wesarg
Message 5 of 16 in “cat_file: take -i/-w parameters”
  1. 01/10 cat_file: take -i/-w parametersBert Wesarg, Oct 8, 2010
  2. 02/10 pretty_tree: globalize and respect -i/-w optionsBert Wesarg, Oct 8, 2010
  3. 03/10 branch_empty: use pretty_tree and therefore respect -i/-wBert Wesarg, Oct 8, 2010
  4. 04/10 tg-path: use pretty_tree and diff-tree to generate the patchBert Wesarg, Oct 8, 2010
  5. 05/10 list_deps: accept -i/-wBert Wesarg, Oct 8, 2010
  6. 06/10 tg-summary: accept -i/-wBert Wesarg, Oct 8, 2010
  7. 07/10 tg-files: list files changed by the topic branchBert Wesarg, Oct 8, 2010
  8. 08/10 tg-prev/tg-next: commands to explore dependenciesBert Wesarg, Oct 8, 2010
  9. 09/10 [RFC] tg-patch: use ui diff when pager is activeBert Wesarg, Oct 8, 2010
  10. 10/10 [RFC] tg-patch: simulate mnemonic prefixesBert Wesarg, Oct 8, 2010
  11. Uwe Kleine-KönigOct 9, 2010
  12. Bert WesargOct 9, 2010
  13. Uwe Kleine-KönigOct 9, 2010
  14. Bert WesargOct 10, 2010
  15. Uwe Kleine-KönigOct 9, 2010
  16. Bert WesargOct 9, 2010

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.