threads / discuss / 59431

Feature Request: Ignore Tracked IDE files

Subject: Feature Request: Ignore Tracked IDE files

## tl;dr

5 messages between Mar 21, 2023 and Mar 22, 2023.

replies: 4people: 2as markdown or json

Ward Hopeman· Mar 21, 2023, 19:49 UTC · lore
Hi,
    I was unable to find this as a prior feature request, so I apologize if this is a duplicate request.
    Request: Create an Ignore section that allows for minimal IDE inclusion without impacting IDE settings for local users.
    Reason for the request: Most engineering teams share some IDE settings when working on code. More often than not, local IDE changes force engineers to resort to using "git update-index --skip-worktree <file>” to avoid the IDE settings files from showing up. It would be nice to be able to identify IDE files that you want in the repository but not necessarily track all changes as most of them are not desired when individuals make those changes for local setup.But teams like to track and have available generic shareable configurations like tabs to space and line length etc. By making it a user configurable section of ignore it allows for future IDEs to be listed without impacting the way it works for common IDEs today. 
    Example workflow: 
Team member Pat creates a new repository. 
Pat sets up the default IDE settings file(s) the way the team “should” be using them, but only minimal settings like line length, tabs to spaces, etc. 
Pat commits the IDEs settings file(s) (often a directory like .idea or .vscode) to the GIT repository. 
Pat adds the IDE settings file to the IDE Ignore section of the .gitignore file. 
Team member Sam checks out the repository. 
Sam opens a local IDE and modifies settings that work for local items like executables etc. 
Sam makes code changes. 
When running `git status` Sam sees a new status section for IDE changes like `untracked` files. 
Sam executes `git add .` and the IDE changes are ignored.
Sam executes `git add -f .ide/settings.json` and the IDE changes are included (note specific file is identified not a general flag).

Thank you for your time, Ward

Sean Allred· Mar 22, 2023, 09:10 UTC · re: Ward Hopeman · lore

Re: Feature Request: Ignore Tracked IDE files

Ward Hopeman <ward.hopeman@nearearth.aero> writes:
Show 14 quoted lines
>     Request: Create an Ignore section that allows for minimal IDE
>     inclusion without impacting IDE settings for local users.
>
>     Reason for the request: Most engineering teams share some IDE
> settings when working on code. More often than not, local IDE changes
> force engineers to resort to using "git update-index --skip-worktree
> <file>” to avoid the IDE settings files from showing up. It would be
> nice to be able to identify IDE files that you want in the repository
> but not necessarily track all changes as most of them are not desired
> when individuals make those changes for local setup. But teams like to
> track and have available generic shareable configurations like tabs to
> space and line length etc. By making it a user configurable section of
> ignore it allows for future IDEs to be listed without impacting the
> way it works for common IDEs today.

It sounds like you are rather after 'public' vs 'private' IDE settings, which would be a feature of the IDE -- not of Git -- and it seems a far simpler model. Public settings are checked-in, private settings are not, and private settings override public settings.

This is used by Visual Studio (IIRC) and possible in other tools (Emacs I know for sure, though I can't imagine VS Code doesn't have this concept by now). It's even the model used by Git itself for some things (.gitignore vs. .git/info/exclude vs. core.excludesfile).

Are these alternative approaches not an option?

-- Sean Allred

Ward Hopeman· Mar 22, 2023, 13:54 UTC · re: Sean Allred · lore

Re: Feature Request: Ignore Tracked IDE files

Hi Sean,
   Thanks for the feedback. I had not considered that the IDEs the teams are using might already have that functionality built in. I thought I had hit the nail on the head, but I agree there appears to be an alternative available. I will pursue those configurations with the team.
   I am curious if you think there is a class of files, under the paradigm I outlined; that need to be tracked initially but then ignored for regular workflows?  Just curious at this point if this was discussed / considered previously.

Thanks, Ward

>
Show 33 quoted lines
> On Mar 22, 2023, at 5:10 AM, Sean Allred <allred.sean@gmail.com> wrote:
> 
> 
> Ward Hopeman <ward.hopeman@nearearth.aero> writes:
>>    Request: Create an Ignore section that allows for minimal IDE
>>    inclusion without impacting IDE settings for local users.
>> 
>>    Reason for the request: Most engineering teams share some IDE
>> settings when working on code. More often than not, local IDE changes
>> force engineers to resort to using "git update-index --skip-worktree
>> <file>” to avoid the IDE settings files from showing up. It would be
>> nice to be able to identify IDE files that you want in the repository
>> but not necessarily track all changes as most of them are not desired
>> when individuals make those changes for local setup. But teams like to
>> track and have available generic shareable configurations like tabs to
>> space and line length etc. By making it a user configurable section of
>> ignore it allows for future IDEs to be listed without impacting the
>> way it works for common IDEs today.
> 
> It sounds like you are rather after 'public' vs 'private' IDE settings,
> which would be a feature of the IDE -- not of Git -- and it seems a far
> simpler model. Public settings are checked-in, private settings are not,
> and private settings override public settings.
> 
> This is used by Visual Studio (IIRC) and possible in other tools (Emacs
> I know for sure, though I can't imagine VS Code doesn't have this
> concept by now). It's even the model used by Git itself for some things
> (.gitignore vs. .git/info/exclude vs. core.excludesfile).
> 
> Are these alternative approaches not an option?
> 
> --
> Sean Allred
Sean Allred· Mar 22, 2023, 13:55 UTC · re: Ward Hopeman · lore

Re: Feature Request: Ignore Tracked IDE files

Ward Hopeman <ward.hopeman@nearearth.aero> writes:
> [...] but I agree there appears to be an alternative available. I will
> pursue those configurations with the team.

Best of luck! Managing settings across a team is always an 'interesting' experience :-)

> I am curious if you think there is a class of files, under the
> paradigm I outlined; that need to be tracked initially but then
> ignored for regular workflows? Just curious at this point if this was
> discussed / considered previously.

It comes up every now and again, but in lieu of specific examples, it always 'seems' to be the wrong approach. The Notes section of git-update-index(1) talks about this a bit:

Show 12 quoted lines
> Users often try to use the assume-unchanged and skip-worktree bits to
> tell Git to ignore changes to files that are tracked. This does not
> work as expected, since Git may still check working tree files against
> the index when performing certain operations. In general, Git does not
> provide a way to ignore changes to tracked files, so alternate
> solutions are recommended.
>
> For example, if the file you want to change is some sort of config
> file, the repository can include a sample config file that can then be
> copied into the ignored name and modified. The repository can even
> include a script to treat the sample file as a template, modifying and
> copying it automatically.

-- Sean Allred

Ward Hopeman· Mar 22, 2023, 14:21 UTC · re: Sean Allred · lore

Re: Feature Request: Ignore Tracked IDE files

Thanks for the info Sean. Best regards, Ward

>
Show 34 quoted lines
> On Mar 22, 2023, at 9:55 AM, Sean Allred <allred.sean@gmail.com> wrote:
> 
> 
> Ward Hopeman <ward.hopeman@nearearth.aero> writes:
>> [...] but I agree there appears to be an alternative available. I will
>> pursue those configurations with the team.
> 
> Best of luck! Managing settings across a team is always an 'interesting'
> experience :-)
> 
>> I am curious if you think there is a class of files, under the
>> paradigm I outlined; that need to be tracked initially but then
>> ignored for regular workflows? Just curious at this point if this was
>> discussed / considered previously.
> 
> It comes up every now and again, but in lieu of specific examples, it
> always 'seems' to be the wrong approach. The Notes section of
> git-update-index(1) talks about this a bit:
> 
>> Users often try to use the assume-unchanged and skip-worktree bits to
>> tell Git to ignore changes to files that are tracked. This does not
>> work as expected, since Git may still check working tree files against
>> the index when performing certain operations. In general, Git does not
>> provide a way to ignore changes to tracked files, so alternate
>> solutions are recommended.
>> 
>> For example, if the file you want to change is some sort of config
>> file, the repository can include a sample config file that can then be
>> copied into the ignored name and modified. The repository can even
>> include a script to treat the sample file as a template, modifying and
>> copying it automatically.
> 
> --
> Sean Allred

← back to recent threads