git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] checkout: fix attribute handling in checkout all

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 12, 2007, 21:50 UTC
Message-ID
<7veji8ifs2.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<118695087531-git-send-email-prohaska@zib.de>
Steffen Prohaska <prohaska@zib.de> writes:
Show 9 quoted lines
> We need to check out .gitattributes files first to have
> them in place when we check out the remaining files. This
> is needed to get the right attributes during checkout,
> for example having the right crlf conversion on the first
> checkout if crlf is controlled by a .gitattribute file.
>
> This works only together with the commit
>
> 'attr: fix attribute handling if .gitattributes is involved'

While I think it is _one_ good approach to make things two-pass, I do not know if this is enough. A logic similar to this should be made available to the codepath that switches branches, shouldn't it?

It feels somewhat bogus to treat only the files that contain ".gitattributes" as substring. Don't you want to at least say "is .gitattributes or ends with /.gitattributes"?

I am not 100% convinced that it is "unexpected" that these two sequences give different results.

 (1) rm -f .gitattributes other
     git-checkout-index -f .gitattributes
     git-checkout-index -f other
 (2) rm -f .gitattributes other
     git-checkout-index -f other
     git-checkout-index -f .gitattributes

And if this is mostly to work around the chicken-and-egg problem of the initial checkout, I do not know if we would want to complicate checkout_all() nor prepare_attr_stack(). Perhaps the _initial_ checkout can do something like:

 * look at index, checkout .gitattributes and */.gitattributes;
 * checkout -f -a
_at the Porcelain level_, without complicating the plumbing?

Both patches are seriously out of existing coding style, by the way. Extra spaces after called function names everywhere, etc.

Previous: Steffen ProhaskaNext: Steffen Prohaska
Message 3 of 20 in “attr: fix attribute handling if .gitattributes is involved”
  1. 1/2 attr: fix attribute handling if .gitattributes is involvedSteffen Prohaska, Aug 12, 2007
  2. 2/2 checkout: fix attribute handling in checkout allSteffen Prohaska, Aug 12, 2007
  3. Junio C HamanoAug 12, 2007
  4. Steffen ProhaskaAug 12, 2007
  5. Junio C HamanoAug 13, 2007
  6. Marius Storm-OlsenAug 13, 2007
  7. Steffen ProhaskaAug 13, 2007
  8. Marius Storm-OlsenAug 13, 2007
  9. Steffen ProhaskaAug 13, 2007
  10. Marius Storm-OlsenAug 13, 2007
  11. Steffen ProhaskaAug 13, 2007
  12. Dmitry KakurinAug 13, 2007
  13. 1/2 attr.c: refactoringJunio C Hamano, Aug 14, 2007
  14. 2/2 attr.c: read .gitattributes from index as well.Junio C Hamano, Aug 14, 2007
  15. Steffen ProhaskaAug 13, 2007
  16. Johannes SchindelinAug 13, 2007
  17. David KastrupAug 13, 2007
  18. git-update-ref bug? (was: [PATCH 2/2] checkout: fix attribute handling in checkout all)David Kastrup, Aug 13, 2007
  19. Junio C HamanoAug 13, 2007
  20. Brian DowningAug 13, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.