Re: [PATCH] MinGW: fix diff --no-index /dev/null ...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Sat, 7 Mar 2009, Junio C Hamano wrote:

> Johannes Schindelin <johannes.schindelin@xxxxxx> writes:
> 
> > diff --git a/diff-no-index.c b/diff-no-index.c
> > index 0a14268..598687b 100644
> > --- a/diff-no-index.c
> > +++ b/diff-no-index.c
> > @@ -38,6 +38,10 @@ static int get_mode(const char *path, int *mode)
> >  
> >  	if (!path || !strcmp(path, "/dev/null"))
> >  		*mode = 0;
> > +#ifdef _WIN32
> > +	else if (!strcasecmp(path, "nul"))
> > +		*mode = 0;
> > +#endif
> >  	else if (!strcmp(path, "-"))
> >  		*mode = create_ce_mode(0666);
> >  	else if (lstat(path, &st))
> 
> I had a brief "Huh? -- doesn't this call for an is_dev_null() helper"
> moment, but I think you are right that diff-no-index.c is the right place
> to special case it.

You're right, it needs to be explained in the commit message.  So how 
about this:

-- snip --
Unlike other places where a string is compared to /dev/null, in this case 
do not parse a diff, but rather command line parameters that have 
possibly been transformed from /dev/null to nul, so that the file can be 
opened.
-- snap --

If you like it, may I ask you to amend the message?

> Should this go to 'maint'?

Technically, yes, as it is a fix.

However, it might not be necessary, as literally all Windows work on Git 
happens in git/mingw.git, git/mingw/j6t.git and git/mingw/4msysgit.git.

Your call.

Thanks,
Dscho
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux