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

Re: [PATCH 2/6] reflog: remove i18n legos in pruning message

From
Jonathan Nieder <jrnieder@gmail.com>
Date
May 31, 2012, 20:31 UTC
Message-ID
<20120531203102.GA27332@burratino>
In-Reply-To
<7vlik86xqd.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> These are for human consumption; they used to go to standard error
> stream back when it was written at 4264dc1 (git reflog expire,
> 2006-12-19).
Good.  Thanks for clarifying and for looking that up.
Why was this changed to write to standard output in 1389d9dd (reflog
expire --fix-stale, 2007-01-06)?  Would changing it back some time
to follow the usual "progress and diagnostics go to stderr" pattern
be worthwhile?
---
 builtin/reflog.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git i/builtin/reflog.c w/builtin/reflog.c
index 062d7dad..90e820a0 100644
--- i/builtin/reflog.c
+++ w/builtin/reflog.c
@@ -327,11 +327,11 @@ static int expire_reflog_ent(unsigned char *osha1, unsigned char *nsha1,
 		hashcpy(cb->last_kept_sha1, nsha1);
 	}
 	if (cb->cmd->verbose)
-		printf("keep %s", message);
+		fprintf(stderr, "keep %s", message);
 	return 0;
  prune:
 	if (!cb->newlog || cb->cmd->verbose)
-		printf("%sprune %s", cb->newlog ? "" : "would ", message);
+		fprintf(stderr, "%sprune %s", cb->newlog ? "" : "would ", message);
 	return 0;
 }
 
@@ -646,10 +646,10 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
 	if (cb.stalefix) {
 		init_revisions(&cb.revs, prefix);
 		if (cb.verbose)
-			printf("Marking reachable objects...");
+			fprintf(stderr, "Marking reachable objects...");
 		mark_reachable_objects(&cb.revs, 0, NULL);
 		if (cb.verbose)
-			putchar('\n');
+			fputc('\n', stderr);
 	}
 
 	if (do_all) {
Previous: Junio C HamanoNext: Nguyễn Thái Ngọc Duy
Message 11 of 17 in “i18n: apply: split to fix a partial i18n message”
  1. i18n: apply: split to fix a partial i18n messageJiang Xin, May 31, 2012
  2. Nguyễn Thái Ngọc DuyMay 31, 2012
  3. 1/6 Remove i18n legos in notifying new branch tracking setupNguyễn Thái Ngọc Duy, May 31, 2012
  4. Jonathan NiederMay 31, 2012
  5. 2/6 reflog: remove i18n legos in pruning messageNguyễn Thái Ngọc Duy, May 31, 2012
  6. Jonathan NiederMay 31, 2012
  7. Nguyen Thai Ngoc DuyMay 31, 2012
  8. Jonathan NiederMay 31, 2012
  9. Nguyen Thai Ngoc DuyMay 31, 2012
  10. Junio C HamanoMay 31, 2012
  11. Jonathan NiederMay 31, 2012
  12. 3/6 merge-recursive: remove i18n legos in conflict messagesNguyễn Thái Ngọc Duy, May 31, 2012
  13. Jonathan NiederMay 31, 2012
  14. Nguyen Thai Ngoc DuyMay 31, 2012
  15. 4/6 notes-merge: remove i18n legos in merge result messageNguyễn Thái Ngọc Duy, May 31, 2012
  16. 5/6 rerere: remove i18n legos in result messageNguyễn Thái Ngọc Duy, May 31, 2012
  17. 6/6 unpack-trees: remove i18n legos in unpack's porcelain error messagesNguyễn Thái Ngọc Duy, May 31, 2012

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.