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

use binmode(STDOUT) in git-status

From
Alex Riesen <raa.lkml@gmail.com>
Date
Nov 28, 2005, 07:34 UTC
Message-ID
<81b0412b0511272334w393434e7lad3e3b102e6c3e9e@mail.gmail.com>

Activision's Perl generates CRLF unless STDOUT is binmoded, which is inconsistent with other output of git-status.

--- I assume none _sane_ can want CRLF as line-ending...

Subject: [PATCH] use binmode on STDOUT to avoid generation of CRLF by activision perl
Signed-off-by: Alex Riesen <fork0@gmail.com>
---
 git-status.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

applies-to: c64901fa1a7f5fa19d025a315bcd1e5d5eae5d93 0fc9f4bdb41725d2b2b54e70ff4740bdb826bdea

diff --git a/git-status.sh b/git-status.sh
index b90ffc1..2fc7595 100755
--- a/git-status.sh
+++ b/git-status.sh
@@ -82,13 +82,14 @@ else
         --exclude-per-directory=.gitignore
 fi |
 perl -e '$/ = "\0";
+	binmode(STDOUT);
 	my $shown = 0;
 	while (<>) {
 		chomp;
 		s|\\|\\\\|g;
 		s|\t|\\t|g;
 		s|\n|\\n|g;
-		s/^/#	/;
+		s/^/#\t/;
 		if (!$shown) {
 			print "#\n# Untracked files:\n";
 			print "#   (use \"git add\" to add to commit)\n#\n";
---
0.99.9.GIT
Next: H. Peter Anvin
Message 1 of 11 in “use binmode(STDOUT) in git-status”
  1. Alex RiesenNov 28, 2005
  2. H. Peter AnvinNov 28, 2005
  3. Johannes SchindelinNov 28, 2005
  4. H. Peter AnvinNov 28, 2005
  5. Johannes SchindelinNov 28, 2005
  6. Alex RiesenNov 29, 2005
  7. [OT] Activision (Re: use binmode(STDOUT) in git-status)Junio C Hamano, Nov 29, 2005
  8. Johannes SchindelinNov 29, 2005
  9. Junio C HamanoNov 28, 2005
  10. Tim O'CallaghanNov 29, 2005
  11. Johannes SchindelinNov 29, 2005

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.