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

Re: "groups of files" in Git?

From
NSNikolay Shustov <nikolay.shustov@gmail.com>
Date
Jul 11, 2017, 18:30 UTC
Message-ID
<CAEcERAypv3x7rFx8sRHyLV0vtn=vBYzjEF9ykJT19YNCAh6JBQ@mail.gmail.com>
In-Reply-To
<CAGZ79kb6-cDo8tmLdJzY=xd-SM_sM0aM9B6=vcKv6DWspmK7vQ@mail.gmail.com>

Thank you for #3. As for 1+2, the documentation says:

"Each line in gitattributes file is of form:
pattern attr1 attr2 ...

... When the pattern matches the path in question, the attributes listed on the line are given to the path."

My understanding is that to have the bunch of the files in the separate directories having the same attribute, I would have to, for each file, create a separate gitattributes line with the exact paths/filename and needed attribute. Is it would you are suggesting or I misunderstood the idea?

On Tue, Jul 11, 2017 at 2:19 PM, Stefan Beller <sbeller@google.com> wrote:
Show 34 quoted lines
> On Tue, Jul 11, 2017 at 11:10 AM, Nikolay Shustov
> <nikolay.shustov@gmail.com> wrote:
>> Thank you for the explanation. The example about backend and frontend
>> is relevant even though I normally have to deal with more layers at
>> the same time.
>>
>> However, in my case I have the thing that you have already tried to
>> address, partially: the changes always align with file boundaries BUT
>> not with directory boundaries. Imagine you have the stack of backend,
>> data transport and frontend layers. The feature has to touch all three
>> layers thus resulting in the changes in the apparently different
>> directories. Thus, making the distinction by the pathspec (if I
>> understood it right from reading the documentation) would not help.
>>
>> The attributes could be a solution, if I could:
>> 1. create attribute designated to the feature
>> 2. "mark" uncommitted files in different directory with that attribute
>
> 1+2 should be answered by the gitattributes man page
> https://git-scm.com/docs/gitattributes
>
>
>> 3. filter the list of unchanged files with such attribute
>
> This sounds like one of
>   "git status :(attr:backend) ."
>   "git status :(exclude,attr:backend) ."
>
>> 4. create commit for the files only with the certain attribute
>>
>> You've kindly demonstrated that #4 is doable; however I could not
>> clearly get for the Git documentation if #1 - #3 are achievable...
>> Could you point me to the right place in the documentation, please?
>>
Previous: Stefan BellerNext: Lars Schneider
Message 14 of 26 in “"groups of files" in Git?”
  1. Nikolay ShustovJul 11, 2017
  2. Stefan BellerJul 11, 2017
  3. Nikolay ShustovJul 11, 2017
  4. Junio C HamanoJul 13, 2017
  5. Nikolay ShustovJul 13, 2017
  6. Junio C HamanoJul 13, 2017
  7. Igor DjordjevicJul 13, 2017
  8. Igor DjordjevicJul 13, 2017
  9. Igor DjordjevicJul 13, 2017
  10. Randall S. BeckerJul 11, 2017
  11. Junio C HamanoJul 11, 2017
  12. Nikolay ShustovJul 11, 2017
  13. Stefan BellerJul 11, 2017
  14. Nikolay ShustovJul 11, 2017
  15. Lars SchneiderJul 11, 2017
  16. Nikolay ShustovJul 11, 2017
  17. Lars SchneiderJul 11, 2017
  18. Nikolay ShustovJul 13, 2017
  19. Igor DjordjevicJul 11, 2017
  20. Nikolay ShustovJul 13, 2017
  21. Junio C HamanoJul 13, 2017
  22. Nikolay ShustovJul 13, 2017
  23. Fredrik GustafssonJul 11, 2017
  24. astianJul 11, 2017
  25. Nikolay ShustovJul 13, 2017
  26. Igor DjordjevicJul 13, 2017

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.