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

[PATCH] git-gui: '/dev/null' on Windows is named 'nul'

From
Johannes Sixt <j.sixt@eudaptics.com>
Date
Mar 7, 2007, 16:26 UTC
Message-ID
<45EEE7BA.E0603922@eudaptics.com>
From: Johannes Sixt <johannes.sixt@telecom.at>

Making (or amending) an initial commit on Windows fails because redirecting something to '/dev/null' must fail - this device does not exist. Redirect to 'nul' instead.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---
 I've noticed this while using the MinGW port, but I do not know whether
 this is needed or even works on Cygwin.
 (Now lets see whether my MUA wraps long lines...)
 -- Hannes
 git-gui/git-gui.sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index f84ba33..971d5fe 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -1288,7 +1288,11 @@ proc commit_committree {fd_wt curHEAD msg} {
 		}
 	} else {
 		# git commit-tree writes to stderr during initial commit.
-		lappend cmd 2>/dev/null
+		if {[is_Windows]} {
+			lappend cmd 2>nul
+		} else {
+			lappend cmd 2>/dev/null
+		}
 	}
 	lappend cmd <$msg_p
 	if {[catch {set cmt_id [eval exec $cmd]} err]} {
-- 
1.5.0.2.279.g4808
Next: Shawn O. Pearce
Message 1 of 2 in “git-gui: '/dev/null' on Windows is named 'nul'”
  1. git-gui: '/dev/null' on Windows is named 'nul'Johannes Sixt, Mar 7, 2007
  2. Shawn O. PearceMar 7, 2007

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.