Hi,
On Wed, Dec 21, 2022 at 03:04:43PM +0700, Arnaud Rebillout wrote:
> 
> On 15/12/2022 15:54, Guido Günther wrote:
> > Or use `gbp clone --git-defuse-attributes=off ...` ?
> 
> Indeed! Thanks, I didn't notice this option, and I can confirm that it
> solves the issue (the exact option name is "--defuse-gitattributes=off"
> actually).
> 
> I took the time to look a bit at this option and where it comes from
> (seemingly, the goal is that gbp is compatible with other tools such as
> dgit). There's still something that strikes me.
> 
> IIUC, it's *only* "gbp clone" that will defuse the git attributes.
> 
> So developer A does "gbp import-orig", brings in the offending attributes:
> still they are not defused on their local copy. Then developer B does "gbp
> pull", and then no change: gbp does not defuse attributes during pull, so
> attributes are still enabled. Then developer C does "gbp clone", and they
> possibly get a different working copy, because in this case only, attributes
> are defused.
> 
> It seems that this behavior is prone to create problems, albeit it might be
> detected by CI (not sure what Salsa CI does in details), and it's also kind
> of a niche issue anyway.

Changing git attributes is certainly a problem. If someone wants to send
patches to e.g. warn the user about that, that would be useful. That
said I'd expect maintainers to filter out .gitattributes from imported
tarballs (e.g. via uscan / debian/changelog or gbp itself)

I think what we could do is:

- warn about git found in upsteam repos / tarballs
- warn about changing git attributes
- allow to disable the either of these via d/gbo.conf

> We took a look at our packaging repos in Kali Linux (~ 600 repos), and we
> found 3 of them that are unclean on `gbp clone`. It's solved by setting
> --defuse-gitattributes. So we will probably add this argument to our
> .mrconfig, and make sure to use it all the time. We'll see where it
> gets us.

Are these repos based on upstream's git or on tarballs that got those
gitattributes imported?

> 
> I'm really not familiar with git attributes, so I don't have any
> recommendation, or anything else to say, I'm merely reporting in case it
> helps.

We have some tests that test defusing git attributes in gbp. If there's
any of your use cases missing, feel free to add those. That is often
a good step to document expected behavior.

Cheers,
 -- Guido

Reply via email to