threads / discuss / 60388

Re: Supporting `git add -a <exclude submodules>`

Subject: Re: Supporting `git add -a <exclude submodules>`

## tl;dr

2 messages between Oct 17, 2023 and Oct 17, 2023.

replies: 1people: 2as markdown or json

Joanna Wang· Oct 17, 2023, 22:48 UTC · lore
 > (2) does collect_some_attrs() or git_check_attr() leave enough
 >   information in check[] to tell between [a] the attr stack had
 >   no opinion on "bits" attribute and [b] the attr stack
 >   explicitly said "bits" attribute is unspecified?
I will double check this but IIUC, I could change this part
(https://github.com/git/git/blob/master/attr.c#L1100-L1105),
such that:
```
if (n == ATTR__UNKNOWN && v = NULL):
  // keep n equal to ATTR_UNKNOWN
```

And here: https://github.com/git/git/blob/master/attr.c#L1238, if value == 'ATTR__UNKNOWN', then keep it at ATTR__UNKNOWN

> (1) where in that callchain would we intercept and insert our own
>   "bits" value based on the filesystem property?
I was planning to do that somewhere around here:
https://github.com/git/git/blob/master/pathspec.c#L764-L767
 and possibly combine it with adding a new match_mode (e.g.
MATCH_BITS) which would be set by parse_pathspec().
Something like:
```
else if (ATTR_UNKNOWN(value))
    matched = (match_mode == MATCH_BITS &&
!strcmp(item->attr_match[i].value, get_mode(path)));
```

I will dive into the code more to confirm, but that's my current high-level plan, in case you immediately see something very wrong.

Junio C Hamano· Oct 17, 2023, 23:02 UTC · re: Joanna Wang · lore
Joanna Wang <jojwang@google.com> writes:
> I will dive into the code more to confirm, but that's my current
> high-level plan, in case you immediately see something very wrong.
Nothing I immediately see glaringly wrong in there ;-)
Thanks for digging!

← back to recent threads