Package: dgit
Version: 11.10
Severity: wishlist
X-Debbugs-Cc: [email protected]
Hi
When using `dgit` on a Debian package where there is a `.gitattributes`
file, I get the warning:
"""
dgit: .gitattributes not (fully) defused. Recommended: dgit setup-new-tree.
"""
For me, this is a "Debian-ism" or a "delta to how everyone else uses
git"[1] and therefore I was hoping we could work towards getting rid of
this workflow delta.
I see this delta as a problem because people wanting to use `dgit` have
to change how they use git compared to everyone else. If I am upstream,
I can use `.gitattributes` to ensure `git` enforces certain properties
for me.
Concretely, I can have `git` enforce that I do not get Windows
newlines into my scripts just because the contributor wrote the patch on
a Windows machine in a less than ideal configured editor[2].
In a standard git workflow, I can edit the `.gitattributes` as needed
and push it. From there on, branches based on that commit will now
respect the delta. This is a nice property for me as an (upstream)
developer.
If I am *also* a Debian packager for the same git repo, I now have to
run a special magic `dgit` rune to "defuse" my `.gitattributes`. Based
on my understanding, I would have to perform this step every time
`.gitattributes` is updated. And this solution does not follow the
standard branch logic, so I can now observe different behavior on a
"defused" check compared to a vanilla one when I change branches.
I think that is an anti-feature for reducing the "Debian specific git
workflow". I am not blind to the possibility that you probably consider
`.gitattributes` an anti-feature for `dgit` given the write up you made
for it.
Nevertheless, I think `dgit` should change its behavior here, since
we are making a Debian specific git workflow and it makes Debian
contributors that are also upstream developers a second class citizen.
Best regards,
Niels
PS: I do not claim to have answers to the problems at hand nor do I
expect it to be easy. :)
[1]: https://lists.debian.org/debian-devel/2024/08/msg00350.html
[2]: Technically, CI would be better at enforcing this case because that
is too much effort to write and test. The `.gitattributes` wins a lot on
being extreme lightweight on implementation given the Windows is a minor
annoyance in most cases.
I also do not seem to be the only one with this mindset:
https://dev.to/deadlybyte/please-add-gitattributes-to-your-git-repository-1jld
https://github.com/gitattributes/gitattributes