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

[PATCH 4/9] git stat: honor relative paths setting

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 15, 2009, 22:39 UTC
Message-ID
<1250375997-10657-5-git-send-email-gitster@pobox.com>
In-Reply-To
<1250375997-10657-4-git-send-email-gitster@pobox.com>

When run from a subdirectory, by default (and when status.relativepaths is set), we should pass it to wt_status_print_body()

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 * Fix-up to 3/9; will be squashed in the final round.
 builtin-commit.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/builtin-commit.c b/builtin-commit.c
index 0ef7c8f..7120876 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -922,6 +922,8 @@ int cmd_stat(int argc, const char **argv, const char *prefix)
 	s.is_initial = get_sha1(s.reference, sha1) ? 1 : 0;
 	wt_status_collect(&s);
 
+	if (s.relative_paths)
+		s.prefix = prefix;
 	if (s.use_color == -1)
 		s.use_color = git_use_color_default;
 	if (diff_use_color_default == -1)
-- 
1.6.4.224.g3be84
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 11 in “"git status" that is not "git commit --dry-run"”
  1. 0/9 "git status" that is not "git commit --dry-run"Junio C Hamano, Aug 15, 2009
  2. 1/9 Documentation/git-commit.txt: describe --dry-runJunio C Hamano, Aug 15, 2009
  3. 2/9 git commit --dry-run -v: show diff in color when askedJunio C Hamano, Aug 15, 2009
  4. 3/9 git stat: the beginningJunio C Hamano, Aug 15, 2009
  5. 4/9 git stat: honor relative paths settingJunio C Hamano, Aug 15, 2009
  6. 5/9 git stat: show traditional status headers and trailers as wellJunio C Hamano, Aug 15, 2009
  7. 6/9 git stat: pathspec limits, unlike traditional "git status"Junio C Hamano, Aug 15, 2009
  8. 7/9 git stat -s: short status outputJunio C Hamano, Aug 15, 2009
  9. 8/9 git status: not "commit --dry-run" anymoreJunio C Hamano, Aug 15, 2009
  10. 9/9 git-status: adjust testsJunio C Hamano, Aug 15, 2009
  11. Thomas RastAug 17, 2009

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.