Bug 580388 - Add option to write to .gitattributes derived resources
Summary: Add option to write to .gitattributes derived resources
Status: NEW
Alias: None
Product: EGit
Classification: Technology
Component: GitHub (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-17 04:29 EDT by Vito De Tullio CLA
Modified: 2022-07-17 11:57 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vito De Tullio CLA 2022-07-17 04:29:42 EDT
Egit already offers an option to automatically append on .gitignore derived resources. It's in Eclipse->Window->Preferences; "Version control (Team)"->Git->Projects; where you can find the option "Automatically ignore derived resources by adding them to .gitignore".
While this is useful in some projects, I think it would be useful to a more fine grained option, where I would like to "Automatically add "linguist-generated=true" attribute to derived resources by adding them to .gitattribute".
Basically I want to leverage what is written on https://docs.github.com/en/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github because there are some file in my project that *are* autogenerated, but that I need to keep in the project itself.
Comment 1 Thomas Wolf CLA 2022-07-17 08:00:20 EDT
A static .gitattributes file that you maintain manually isn't good enough?

I would expect such generated files to be in particular folders or have particular extensions, so that some static rule like, for instance,

  src-gen/**   linguist-generated

should be able to catch them.
Comment 2 Vito De Tullio CLA 2022-07-17 11:57:15 EDT
Sure, I can write the .gitattribute myself (in my case it's a little bit more complex, because I have about 4 "roots" of generated sources, and also some exceptions, but nothing that cannot be handled manually).

But - in the various project I work on I also use a plugin (autoderiv - https://nodj.github.io/AutoDeriv) to automatically mark resources as derived.
In my workflow I have just one file as "source of truth" for derived resources, .derived, in the the root of the project.

AutoDeriv automatically mark the files/folders as derived in eclipse (so, for example, the search automatically ignores those resources), and EGit automatically updates the .gitignore file.

This is good for almost all of my projects (BTW thanks for the .gitignore feature!).

Now in this project I need to keep track of these derived resources, and I would hope to have a "variation" of the .gitignore scenario