diff mbox series

[v2,20/23] .gitignore: touch up the entries regarding Visual Studio

Message ID dc4a9cc6205afac03d1154ca935e4334536fa693.1564430879.git.gitgitgadget@gmail.com (mailing list archive)
State New, archived
Headers show
Series Reinstate support for Visual Studio | expand

Commit Message

Linus Arver via GitGitGadget July 29, 2019, 8:08 p.m. UTC
From: Philip Oakley <philipoakley@iee.org>

Add the Microsoft .manifest pattern, and do not anchor the 'Debug'
and 'Release' entries at the top-level directory, to allow for
multiple projects (one per target).

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 .gitignore | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

SZEDER Gábor Aug. 25, 2019, 12:07 p.m. UTC | #1
On Mon, Jul 29, 2019 at 01:08:14PM -0700, Philip Oakley via GitGitGadget wrote:
> Add the Microsoft .manifest pattern, and do not anchor the 'Debug'
> and 'Release' entries at the top-level directory, to allow for
> multiple projects (one per target).
> 
> Signed-off-by: Philip Oakley <philipoakley@iee.org>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>  .gitignore | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/.gitignore b/.gitignore
> index e096e0a51c..e7bb15d301 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -230,6 +230,7 @@
>  *.ipdb
>  *.dll
>  .vs/
> -/Debug/
> -/Release/
> +*.manifest

This new line ignores the tracked file 'compat/win32/git.manifest'
that was added fairly recently in fe90397604 (mingw: embed a manifest
to trick UAC into Doing The Right Thing, 2019-06-27).

I wonder whether that's intentional or accidental.

I'm inclined to think that it's merely accidental, because, as far as
I understand, this is an old-ish patch from times when there wasn't
any 'git.manifest' file in tree, and simply noone noticed that in the
meantime we got one.  But I have no idea about how a Git build with
Visual Studio is supposed to work, so it doesn't really matter what
I'm inclined to think :)
Philip Oakley Aug. 25, 2019, 1:20 p.m. UTC | #2
Hi Szeder,

On 25/08/2019 13:07, SZEDER Gábor wrote:
> On Mon, Jul 29, 2019 at 01:08:14PM -0700, Philip Oakley via GitGitGadget wrote:
>> Add the Microsoft .manifest pattern, and do not anchor the 'Debug'
>> and 'Release' entries at the top-level directory, to allow for
>> multiple projects (one per target).
>>
>> Signed-off-by: Philip Oakley <philipoakley@iee.org>
>> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
>> ---
>>   .gitignore | 5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/.gitignore b/.gitignore
>> index e096e0a51c..e7bb15d301 100644
>> --- a/.gitignore
>> +++ b/.gitignore
>> @@ -230,6 +230,7 @@
>>   *.ipdb
>>   *.dll
>>   .vs/
>> -/Debug/
>> -/Release/
>> +*.manifest
> This new line ignores the tracked file 'compat/win32/git.manifest'
> that was added fairly recently in fe90397604 (mingw: embed a manifest
> to trick UAC into Doing The Right Thing, 2019-06-27).
>
> I wonder whether that's intentional or accidental.
>
> I'm inclined to think that it's merely accidental, because, as far as
> I understand, this is an old-ish patch from times when there wasn't
> any 'git.manifest' file in tree, and simply noone noticed that in the
> meantime we got one.  But I have no idea about how a Git build with
> Visual Studio is supposed to work, so it doesn't really matter what
> I'm inclined to think :)
>
At the time, it was just one of the many non-source files that were 
generated by Visual Studio that cluttered the status list and also could 
accidentally added to the tracked files.

The newly added .manifest file does appear to be there to 'trick' the 
Windows User Access Control (UAC) which otherwise can be an annoyance to 
'regular' users.
Philip
SZEDER Gábor Aug. 25, 2019, 7:09 p.m. UTC | #3
On Sun, Aug 25, 2019 at 02:20:32PM +0100, Philip Oakley wrote:
> Hi Szeder,
> 
> On 25/08/2019 13:07, SZEDER Gábor wrote:
> >On Mon, Jul 29, 2019 at 01:08:14PM -0700, Philip Oakley via GitGitGadget wrote:
> >>Add the Microsoft .manifest pattern, and do not anchor the 'Debug'
> >>and 'Release' entries at the top-level directory, to allow for
> >>multiple projects (one per target).
> >>
> >>Signed-off-by: Philip Oakley <philipoakley@iee.org>
> >>Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> >>---
> >>  .gitignore | 5 +++--
> >>  1 file changed, 3 insertions(+), 2 deletions(-)
> >>
> >>diff --git a/.gitignore b/.gitignore
> >>index e096e0a51c..e7bb15d301 100644
> >>--- a/.gitignore
> >>+++ b/.gitignore
> >>@@ -230,6 +230,7 @@
> >>  *.ipdb
> >>  *.dll
> >>  .vs/
> >>-/Debug/
> >>-/Release/
> >>+*.manifest
> >This new line ignores the tracked file 'compat/win32/git.manifest'
> >that was added fairly recently in fe90397604 (mingw: embed a manifest
> >to trick UAC into Doing The Right Thing, 2019-06-27).
> >
> >I wonder whether that's intentional or accidental.
> >
> >I'm inclined to think that it's merely accidental, because, as far as
> >I understand, this is an old-ish patch from times when there wasn't
> >any 'git.manifest' file in tree, and simply noone noticed that in the
> >meantime we got one.  But I have no idea about how a Git build with
> >Visual Studio is supposed to work, so it doesn't really matter what
> >I'm inclined to think :)
> >
> At the time, it was just one of the many non-source files that were
> generated by Visual Studio that cluttered the status list and also could
> accidentally added to the tracked files.
> 
> The newly added .manifest file does appear to be there to 'trick' the
> Windows User Access Control (UAC) which otherwise can be an annoyance to
> 'regular' users.

Sorry, I'm not sure how to interpret your reply, and can't decide
whether it tries to justify why that tracked file should be ignored,
or explains that ignoring it was accidental.

Anyway, ignoring that tracked file apparently triggered a nested
worktree-related bug in 'git clean', which can lead to data loss:

https://public-inbox.org/git/20190825185918.3909-1-szeder.dev@gmail.com/
Philip Oakley Aug. 25, 2019, 10:21 p.m. UTC | #4
Hi Szeder,

On 25/08/2019 20:09, SZEDER Gábor wrote:
> On Sun, Aug 25, 2019 at 02:20:32PM +0100, Philip Oakley wrote:
>> Hi Szeder,
>>
>> On 25/08/2019 13:07, SZEDER Gábor wrote:
>>> On Mon, Jul 29, 2019 at 01:08:14PM -0700, Philip Oakley via GitGitGadget wrote:
>>>> Add the Microsoft .manifest pattern, and do not anchor the 'Debug'
>>>> and 'Release' entries at the top-level directory, to allow for
>>>> multiple projects (one per target).
>>>>
>>>> Signed-off-by: Philip Oakley <philipoakley@iee.org>
>>>> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
>>>> ---
>>>>   .gitignore | 5 +++--
>>>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/.gitignore b/.gitignore
>>>> index e096e0a51c..e7bb15d301 100644
>>>> --- a/.gitignore
>>>> +++ b/.gitignore
>>>> @@ -230,6 +230,7 @@
>>>>   *.ipdb
>>>>   *.dll
>>>>   .vs/
>>>> -/Debug/
>>>> -/Release/
>>>> +*.manifest
>>> This new line ignores the tracked file 'compat/win32/git.manifest'
>>> that was added fairly recently in fe90397604 (mingw: embed a manifest
>>> to trick UAC into Doing The Right Thing, 2019-06-27).
>>>
>>> I wonder whether that's intentional or accidental.
>>>
>>> I'm inclined to think that it's merely accidental, because, as far as
>>> I understand, this is an old-ish patch from times when there wasn't
>>> any 'git.manifest' file in tree, and simply noone noticed that in the
>>> meantime we got one.  But I have no idea about how a Git build with
>>> Visual Studio is supposed to work, so it doesn't really matter what
>>> I'm inclined to think :)
>>>
>> At the time, it was just one of the many non-source files that were
>> generated by Visual Studio that cluttered the status list and also could
>> accidentally added to the tracked files.
>>
>> The newly added .manifest file does appear to be there to 'trick' the
>> Windows User Access Control (UAC) which otherwise can be an annoyance to
>> 'regular' users.
> Sorry, I'm not sure how to interpret your reply, and can't decide
> whether it tries to justify why that tracked file should be ignored,
> or explains that ignoring it was accidental.
>
> Anyway, ignoring that tracked file apparently triggered a nested
> worktree-related bug in 'git clean', which can lead to data loss:
>
> https://public-inbox.org/git/20190825185918.3909-1-szeder.dev@gmail.com/
>
Basically manifests are a build artefact from Visual Studio [1], so it 
was just another file to be ignored, from a _source_ control control 
viewpoint.

I hadn't fully appreciated the reason for your question, but I can now 
see how the general 'ignore most, but keep an occasional' file type can 
be a problem for the `git clean` filter, along with sub-module repos in 
sub-directories. It probably extends beyond this special case .manifest 
file.

I doubt that dscho wants to also do file renaming to achieve the trick 
that added that file to avoid this. the clean command should never be 
ignoring (and possibly deleting) tracked files.

When clean hits a nested repo (maybe with .git directory - not sure of 
some of the sub-module changes) then it should stop referring to that 
top level gitignore, at least that's my expectation. The commit 
description in the referenced patch appears to get the two parts 
inter-twined.

Philip
[1] 
https://docs.microsoft.com/en-us/cpp/build/manifest-generation-in-visual-studio?view=vs-2019
SZEDER Gábor Aug. 26, 2019, 9:10 a.m. UTC | #5
On Sun, Aug 25, 2019 at 11:21:23PM +0100, Philip Oakley wrote:
> >>>>diff --git a/.gitignore b/.gitignore
> >>>>index e096e0a51c..e7bb15d301 100644
> >>>>--- a/.gitignore
> >>>>+++ b/.gitignore
> >>>>@@ -230,6 +230,7 @@
> >>>>  *.ipdb
> >>>>  *.dll
> >>>>  .vs/
> >>>>-/Debug/
> >>>>-/Release/
> >>>>+*.manifest
> >>>This new line ignores the tracked file 'compat/win32/git.manifest'
> >>>that was added fairly recently in fe90397604 (mingw: embed a manifest
> >>>to trick UAC into Doing The Right Thing, 2019-06-27).
> >>>
> >>>I wonder whether that's intentional or accidental.
> >>>
> >>>I'm inclined to think that it's merely accidental, because, as far as
> >>>I understand, this is an old-ish patch from times when there wasn't
> >>>any 'git.manifest' file in tree, and simply noone noticed that in the
> >>>meantime we got one.  But I have no idea about how a Git build with
> >>>Visual Studio is supposed to work, so it doesn't really matter what
> >>>I'm inclined to think :)
> >>>
> >>At the time, it was just one of the many non-source files that were
> >>generated by Visual Studio that cluttered the status list and also could
> >>accidentally added to the tracked files.
> >>
> >>The newly added .manifest file does appear to be there to 'trick' the
> >>Windows User Access Control (UAC) which otherwise can be an annoyance to
> >>'regular' users.
> >Sorry, I'm not sure how to interpret your reply, and can't decide
> >whether it tries to justify why that tracked file should be ignored,
> >or explains that ignoring it was accidental.
> >
> >Anyway, ignoring that tracked file apparently triggered a nested
> >worktree-related bug in 'git clean', which can lead to data loss:
> >
> >https://public-inbox.org/git/20190825185918.3909-1-szeder.dev@gmail.com/
> >
> Basically manifests are a build artefact from Visual Studio [1], so it was
> just another file to be ignored, from a _source_ control control viewpoint.

I understand that manifest files, in general, are build artifacts.
But does Visual Studio overwrite the existing
'compat/win32/git.manifest' file in particular?  Yes or no? :)
Johannes Schindelin Aug. 26, 2019, 2:57 p.m. UTC | #6
Hi,

On Sun, 25 Aug 2019, Philip Oakley wrote:

> On 25/08/2019 20:09, SZEDER Gábor wrote:
> > On Sun, Aug 25, 2019 at 02:20:32PM +0100, Philip Oakley wrote:
> > >
> > > On 25/08/2019 13:07, SZEDER Gábor wrote:
> > > > On Mon, Jul 29, 2019 at 01:08:14PM -0700, Philip Oakley via GitGitGadget
> > > > wrote:
> > > > > Add the Microsoft .manifest pattern, and do not anchor the 'Debug'
> > > > > and 'Release' entries at the top-level directory, to allow for
> > > > > multiple projects (one per target).
> > > > >
> > > > > Signed-off-by: Philip Oakley <philipoakley@iee.org>
> > > > > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> > > > > ---
> > > > >   .gitignore | 5 +++--
> > > > >   1 file changed, 3 insertions(+), 2 deletions(-)
> > > > >
> > > > > diff --git a/.gitignore b/.gitignore
> > > > > index e096e0a51c..e7bb15d301 100644
> > > > > --- a/.gitignore
> > > > > +++ b/.gitignore
> > > > > @@ -230,6 +230,7 @@
> > > > >   *.ipdb
> > > > >   *.dll
> > > > >   .vs/
> > > > > -/Debug/
> > > > > -/Release/
> > > > > +*.manifest
> > > > This new line ignores the tracked file 'compat/win32/git.manifest'
> > > > that was added fairly recently in fe90397604 (mingw: embed a manifest
> > > > to trick UAC into Doing The Right Thing, 2019-06-27).
> > > >
> > > > I wonder whether that's intentional or accidental.

This was an oversight of mine, my apologies. That line should go.

> > > > I'm inclined to think that it's merely accidental, because, as far as
> > > > I understand, this is an old-ish patch from times when there wasn't
> > > > any 'git.manifest' file in tree, and simply noone noticed that in the
> > > > meantime we got one.  But I have no idea about how a Git build with
> > > > Visual Studio is supposed to work, so it doesn't really matter what
> > > > I'm inclined to think :)
> > > >
> > > At the time, it was just one of the many non-source files that were
> > > generated by Visual Studio that cluttered the status list and also could
> > > accidentally added to the tracked files.
> > >
> > > The newly added .manifest file does appear to be there to 'trick' the
> > > Windows User Access Control (UAC) which otherwise can be an annoyance to
> > > 'regular' users.
> > Sorry, I'm not sure how to interpret your reply, and can't decide
> > whether it tries to justify why that tracked file should be ignored,
> > or explains that ignoring it was accidental.
> >
> > Anyway, ignoring that tracked file apparently triggered a nested
> > worktree-related bug in 'git clean', which can lead to data loss:
> >
> > https://public-inbox.org/git/20190825185918.3909-1-szeder.dev@gmail.com/

Whoa. At least we found a bug via my oversight ;-)

> Basically manifests are a build artefact from Visual Studio [1], so it was
> just another file to be ignored, from a _source_ control control viewpoint.

More precisely, manifest files are something specific to Windows, where
you can embed metadata in an executable. Visual Studio auto-generated it
under certain circumstances, but recent versions seem not to do that
anymore.

Ciao,
Dscho

> I hadn't fully appreciated the reason for your question, but I can now see how
> the general 'ignore most, but keep an occasional' file type can be a problem
> for the `git clean` filter, along with sub-module repos in sub-directories. It
> probably extends beyond this special case .manifest file.
>
> I doubt that dscho wants to also do file renaming to achieve the trick that
> added that file to avoid this. the clean command should never be ignoring (and
> possibly deleting) tracked files.
>
> When clean hits a nested repo (maybe with .git directory - not sure of some of
> the sub-module changes) then it should stop referring to that top level
> gitignore, at least that's my expectation. The commit description in the
> referenced patch appears to get the two parts inter-twined.
>
> Philip
> [1]
> https://docs.microsoft.com/en-us/cpp/build/manifest-generation-in-visual-studio?view=vs-2019
>
Junio C Hamano Aug. 26, 2019, 3:49 p.m. UTC | #7
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

>> > > > > --- a/.gitignore
>> > > > > +++ b/.gitignore
>> > > > > @@ -230,6 +230,7 @@
>> > > > >   *.ipdb
>> > > > >   *.dll
>> > > > >   .vs/
>> > > > > -/Debug/
>> > > > > -/Release/
>> > > > > +*.manifest
>> > > > This new line ignores the tracked file 'compat/win32/git.manifest'
>> > > > that was added fairly recently in fe90397604 (mingw: embed a manifest
>> > > > to trick UAC into Doing The Right Thing, 2019-06-27).
>> > > >
>> > > > I wonder whether that's intentional or accidental.
>
> This was an oversight of mine, my apologies. That line should go.

Good to see people finding glitches in topics that have graduated to
'master' not so long ago.  It would have been even nicer if we found
them while in 'next', but we are all human ;-)

> More precisely, manifest files are something specific to Windows, where
> you can embed metadata in an executable. Visual Studio auto-generated it
> under certain circumstances, but recent versions seem not to do that
> anymore.

I expect somebody who knows Windows .manifest better than I do to
come up with a one-liner patch with a single paragraph log message.
Or it can just be a part of a larger series that is the next batch
of Windows updates.

Thanks.
Johannes Schindelin Aug. 28, 2019, 11:34 a.m. UTC | #8
Hi Gábor,

On Mon, 26 Aug 2019, SZEDER Gábor wrote:

> On Sun, Aug 25, 2019 at 11:21:23PM +0100, Philip Oakley wrote:
> > >>>>diff --git a/.gitignore b/.gitignore
> > >>>>index e096e0a51c..e7bb15d301 100644
> > >>>>--- a/.gitignore
> > >>>>+++ b/.gitignore
> > >>>>@@ -230,6 +230,7 @@
> > >>>>  *.ipdb
> > >>>>  *.dll
> > >>>>  .vs/
> > >>>>-/Debug/
> > >>>>-/Release/
> > >>>>+*.manifest
> > >>>This new line ignores the tracked file 'compat/win32/git.manifest'
> > >>>that was added fairly recently in fe90397604 (mingw: embed a manifest
> > >>>to trick UAC into Doing The Right Thing, 2019-06-27).
> > >>>
> > >>>I wonder whether that's intentional or accidental.
> > >>>
> > >>>I'm inclined to think that it's merely accidental, because, as far as
> > >>>I understand, this is an old-ish patch from times when there wasn't
> > >>>any 'git.manifest' file in tree, and simply noone noticed that in the
> > >>>meantime we got one.  But I have no idea about how a Git build with
> > >>>Visual Studio is supposed to work, so it doesn't really matter what
> > >>>I'm inclined to think :)
> > >>>
> > >>At the time, it was just one of the many non-source files that were
> > >>generated by Visual Studio that cluttered the status list and also could
> > >>accidentally added to the tracked files.
> > >>
> > >>The newly added .manifest file does appear to be there to 'trick' the
> > >>Windows User Access Control (UAC) which otherwise can be an annoyance to
> > >>'regular' users.
> > >Sorry, I'm not sure how to interpret your reply, and can't decide
> > >whether it tries to justify why that tracked file should be ignored,
> > >or explains that ignoring it was accidental.
> > >
> > >Anyway, ignoring that tracked file apparently triggered a nested
> > >worktree-related bug in 'git clean', which can lead to data loss:
> > >
> > >https://public-inbox.org/git/20190825185918.3909-1-szeder.dev@gmail.com/
> > >
> > Basically manifests are a build artefact from Visual Studio [1], so it was
> > just another file to be ignored, from a _source_ control control viewpoint.
>
> I understand that manifest files, in general, are build artifacts.
> But does Visual Studio overwrite the existing
> 'compat/win32/git.manifest' file in particular?  Yes or no? :)

No.

The reason this entry was there: at least _some_ Visual Studio versions
(IIRC), auto-generates `.manifest` files when the project does not have
any. But now we do. So this line's gotta go.

#leftoverbits ?

Ciao,
Dscho
diff mbox series

Patch

diff --git a/.gitignore b/.gitignore
index e096e0a51c..e7bb15d301 100644
--- a/.gitignore
+++ b/.gitignore
@@ -230,6 +230,7 @@ 
 *.ipdb
 *.dll
 .vs/
-/Debug/
-/Release/
+*.manifest
+Debug/
+Release/
 *.dSYM