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

[PATCH] shortlog: initialize nongit variable

From
SZEDER Gábor <szeder@ira.uka.de>
Date
Mar 25, 2008, 14:46 UTC
Message-ID
<1206456377-2735-1-git-send-email-szeder@ira.uka.de>

setup_git_directory_gently() only modifies the value of the nongit variable if we are not in a git repository, therefore nongit is left uninitialized if we are in a git repository. This sometimes broke shortlog when it was not fed with a log on its standard input.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
 builtin-shortlog.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-shortlog.c b/builtin-shortlog.c
index bd795b1..60a6d45 100644
--- a/builtin-shortlog.c
+++ b/builtin-shortlog.c
@@ -229,7 +229,7 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix)
 {
 	struct shortlog log;
 	struct rev_info rev;
-	int nongit;
+	int nongit = 0;
 
 	prefix = setup_git_directory_gently(&nongit);
 	shortlog_init(&log);
-- 
1.5.5.rc1
Next: Nguyen Thai Ngoc Duy
Message 1 of 5 in “shortlog: initialize nongit variable”
  1. shortlog: initialize nongit variableSZEDER Gábor, Mar 25, 2008
  2. Nguyen Thai Ngoc DuyMar 25, 2008
  3. SZEDER GáborMar 25, 2008
  4. Jonas FonsecaMar 25, 2008
  5. SZEDER GáborMar 25, 2008

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.