Message ID | xmqqa5jzqd5k.fsf_-_@gitster.g (mailing list archive) |
---|---|
State | Accepted |
Commit | 5c71d6b63ac107a1c0f6e6a3f53f2b8371516292 |
Headers | show |
Series | attr.tree: HEAD:.gitattributes is no longer the default in a bare repo | expand |
On Wed, Jun 05, 2024 at 02:43:03PM -0700, Junio C Hamano wrote: > 51441e64 (stop using HEAD for attributes in bare repository by > default, 2024-05-03) has addressed a recent performance regression > by partially reverting a topic that was merged at 26dd307c (Merge > branch 'jc/attr-tree-config', 2023-10-30). But it forgot to update > the documentation to remove the mention of a special case in bare > repositories. > > Let's update the document before the update hits the next release. Good catch, and the patch looks good. I think 51441e64 is essentially a revert of 2386535511 (attr: read attributes from HEAD when bare repo, 2023-10-13). I don't know how you prepared it, but I'd probably have started with "cherry-pick -n". But that wouldn't help, because the documentation didn't come until after that in 9f9c40cf34 (attr: add attr.tree for setting the treeish to read attributes from, 2023-10-13). Not that it really matters much now, but always just curious about how we can avoid missing stuff like this next time. -Peff
Jeff King <peff@peff.net> writes: > I think 51441e64 is essentially a revert of 2386535511 (attr: read > attributes from HEAD when bare repo, 2023-10-13). I don't know how you > prepared it, but I'd probably have started with "cherry-pick -n". But > that wouldn't help, because the documentation didn't come until after > that in 9f9c40cf34 (attr: add attr.tree for setting the treeish to read > attributes from, 2023-10-13). "revert -m 1" followed by "commit --amend" might have worked well in this case to get rid of the code that came from one and doc update that came from the other in a two patch series, but in general, that would be too much noise to wade through in general. > Not that it really matters much now, but always just curious about how > we can avoid missing stuff like this next time. The series first did "HEAD tree is used in bare" without doc, and followed up with "configuration can be used to name any tree" with doc that mentions the behaviour of the first step as a special case of default value for the configuration variable. The only way it could have been made easier to spot is to introduce the variable with documentation first, and then do the "bare repo uses HEAD as the default" thing on top.
diff --git c/Documentation/config/attr.txt w/Documentation/config/attr.txt index 1a482d6af2..c4a5857993 100644 --- c/Documentation/config/attr.txt +++ w/Documentation/config/attr.txt @@ -1,7 +1,6 @@ attr.tree:: A reference to a tree in the repository from which to read attributes, - instead of the `.gitattributes` file in the working tree. In a bare - repository, this defaults to `HEAD:.gitattributes`. If the value does - not resolve to a valid tree object, an empty tree is used instead. + instead of the `.gitattributes` file in the working tree. If the value + does not resolve to a valid tree object, an empty tree is used instead. When the `GIT_ATTR_SOURCE` environment variable or `--attr-source` command line option are used, this configuration variable has no effect.
51441e64 (stop using HEAD for attributes in bare repository by default, 2024-05-03) has addressed a recent performance regression by partially reverting a topic that was merged at 26dd307c (Merge branch 'jc/attr-tree-config', 2023-10-30). But it forgot to update the documentation to remove the mention of a special case in bare repositories. Let's update the document before the update hits the next release. Signed-off-by: Junio C Hamano <gitster@pobox.com> --- Documentation/config/attr.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)