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

Re: [PATCH 1/1] Use correct /dev/null for UNIX and Windows

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Oct 31, 2018, 11:10 UTC
Message-ID
<nycvar.QRO.7.76.6.1810311206230.4546@tvgsbejvaqbjf.bet>
In-Reply-To
<xmqqbm7awsvr.fsf@gitster-ct.c.googlers.com>
Hi Junio,
On Wed, 31 Oct 2018, Junio C Hamano wrote:
Show 30 quoted lines
> Chris Webster <chris@webstech.net> writes:
> 
> >>> > Use File::Spec->devnull() for output redirection to avoid messages
> >>> > when Windows version of Perl is first in path.  The message 'The
> >>>
> >>> Dscho, "Windows version of Perl is first in path" somehow feels
> >>> contradicting with what one of the topics I saw from you were trying
> >>> to enforce (or, at least, "set as the supported configuration").
> >>>
> >>> I am guessing that the Perl you are building and shipping with Git
> >>> for Windows would yield what the shell that ends up running the
> >>> scriptlet `git config --get-color $key` prefers when asked for
> >>> File::Spec->devnull(), and nothing will break with this patch even
> >>> if that is "/dev/null", but I thought I'd double check.
> >>>
> >>> Thanks.
> >>>
> > This problem originally showed up in the
> > https://github.com/so-fancy/diff-so-fancy project, which has a copy of
> > DiffHighlight.pm.   That project allows diffsofancy (perl) to be run
> > from the command line without requiring the bash environment ((well ,
> > sort of) including the associated perl).
> 
> Thanks for additional comments.  
> 
> In any case, Windows is not my bailiwick, so I'll hope that the
> above comments from you would help Dscho in his response and wait.
> I know use of File::Spec->devnull() won't hurt POSIX folks so making
> sure this won't break Git for Windows is the primary thing I woudl
> worry about this patch.

Indeed, the patch in question regards something I consider outside Git for Windows' realm. As Chris said, you can run this script from a PowerShell prompt, without any Git Bash (and without Git's Perl) involved.

I am fine with this patch, as long as the author name is fixed to match the name in the Signed-off-by: footer ;-) [*1*]

Ciao, Dscho

Footnote *1*: This patch came in via GitGitGadget, and if I had infinite amounts of time, I would probably implement some rudimentary pre-checks, such as: does the Author: header match the first Signed-off-by: footer, is the commit message wrapped correctly, does the oneline have a prefix and continues lower-case, etc. And GitGitGadget would then point out the issues, possibly even try to fix them and push up the fixed commits.

If anybody agrees with these goals and is curious enough to dive into some Typescript programming, I'd be very happy to guide that person through implementing this ;-)

Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 18 in “DiffHighlight.pm: Use correct /dev/null for UNIX and Windows”
  1. 0/1 DiffHighlight.pm: Use correct /dev/null for UNIX and WindowsChris. Webster via GitGitGadget, Oct 30, 2018
  2. 1/1 Use correct /dev/null for UNIX and Windowschris via GitGitGadget, Oct 30, 2018
  3. Jeff KingOct 31, 2018
  4. Junio C HamanoOct 31, 2018
  5. Junio C HamanoOct 31, 2018
  6. Junio C HamanoOct 31, 2018
  7. Johannes SchindelinOct 31, 2018
  8. 0/1 DiffHighlight.pm: Use correct /dev/null for UNIX and WindowsChris. Webster via GitGitGadget, Oct 31, 2018
  9. Chris WebsterOct 31, 2018
  10. Junio C HamanoOct 31, 2018
  11. Johannes SchindelinOct 31, 2018
  12. Junio C HamanoNov 1, 2018
  13. Johannes SchindelinNov 6, 2018
  14. Chris WebsterMay 7, 2019
  15. Philip OakleyMay 12, 2019
  16. Fwd: [PATCH v2 1/1] diff-highlight: Use correct /dev/null for UNIX and WindowsGit Gadget, May 8, 2019
  17. Junio C HamanoMay 9, 2019
  18. Johannes SchindelinMay 9, 2019

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.