« first day (2558 days earlier)      last day (921 days later) » 

7:15 AM
I've had a look at the .gitignore of many big projects and I've noticed something: almost nobody knows how they work... They're simple but almost nobody had a look at the doc
 
@DenysSéguret Well, I'm not sure I ever read the specification for a .gitignore... 😅 What gives it away?
 
Things like **/thing. It's equivalent to just thing. You can see this PR I made yesterday for a rule which does something unwanted. But in almost all cases, the rules are just redundant or uselessely complicated with absolutely no impact on the life of the project so nobody cares. It's very rare to have real problems with the ignoring rules, even with bad rules, so nobody bothers looking at the doc
It's full of useless stuff
It doesn't look like somebody carefully crafted it with love as should be every part of a project. This is sad.
Another example: img/**. This makes no sense
 
 
4 hours later…
11:41 AM
@DenysSéguret I've noticed that as well. I think the only time ** is really necessary is in a pattern like a/**/b, and such patterns are rarely needed. And in that case, you could just ignore b in a/.gitignore instead.
(unless a appears all over the place...)
 
Yes, ** is only necessary when you want to match things at any position but only in part of your tree
 
11:58 AM
@FrancisGagné In case you choose to have directory-level ignore files, instead of a single, top-level one. Both approaches have their advantages and disadvantages, so I'm not saying that's bad, I'm merely suggesting, it may not be the obvious choice over a/**/b.
 
12:39 PM
Using match is often more verbose than just a few if but I find it somehow much easier to reason about and to comment
 
1:21 PM
@DenysSéguret I did
but don't remember everything
 
 
3 hours later…
4:31 PM
This will cause the drop checker to think that dropping A might drop values of type T and/or R. To prevent that, one can declare phantom data as PhantomData<fn() -> (T, R)>. — user4815162342 2 hours ago
I fail to see how that could be a problem
 
4:43 PM
too theoretical for me
if compiler is not smart enough and we need to use phantom data I doubt compiler will care about that
 
5:31 PM
@DenysSéguret !/img/** would be fine, right? If one wanted to have that folder to be committed, but none of its contents?
I should read into it more later on. I’ve been surprised by how it worked before.
 
@Jason that would be /img/** but this isn't a frequent case, I think
 
Oh, ha, right, .gitignore, not .gitallow. My brain is gooey. Long day. Indeed, not a common case.
 
 
5 hours later…
10:18 PM
@Jason Git doesn't support committing empty directories anyway (Git trees technically support it, I believe, but the index doesn't track directories, only files, or something like that)
the common workaround is... adding a dummy .gitignore file to the otherwise empty directory!
and ignoring /img/* should be enough, because this matches directories, and directories that match an ignore rule are not traversed at all (i.e. the whole subtree is ignored recursively)
 
10:45 PM
@FrancisGagné Thank you! I think I might have done it that way quite some time ago! The directory had to somehow exist for a build and I opted for something similar :-)
 

« first day (2558 days earlier)      last day (921 days later) »