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

[TOPGIT PATCH] Make 'tg patch' work in subdirectories

From
Michal Sojka <sojkam1@fel.cvut.cz>
Date
Feb 2, 2010, 10:31 UTC
Message-ID
<1265106672-18518-1-git-send-email-sojkam1@fel.cvut.cz>

When 'tg patch' is called from a subdirectory, it outputs only the commit message and no diff.

Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
---
 tg-patch.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/tg-patch.sh b/tg-patch.sh
index d701c54..f703a87 100644
--- a/tg-patch.sh
+++ b/tg-patch.sh
@@ -56,6 +56,7 @@ git diff --name-only $diff_opts "$base_rev" ${diff_committed_only:+"$name"} -- |
 	fgrep -vx ".topdeps" |
 	fgrep -vx ".topmsg" >"$git_is_stupid" || : # fgrep likes to fail randomly?
 if [ -s "$git_is_stupid" ]; then
+	cd "$root_dir"
 	cat "$git_is_stupid" | xargs git diff --patch-with-stat $diff_opts "$base_rev" ${diff_committed_only:+"$name"} --
 else
 	echo "No changes."
-- 
tg: (341a371..) t/make-patch-work-in-subdir (depends on: master)
Next: Uwe Kleine-König
Message 1 of 2 in “Make 'tg patch' work in subdirectories”
  1. Make 'tg patch' work in subdirectoriesMichal Sojka, Feb 2, 2010
  2. Uwe Kleine-KönigFeb 2, 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.