Bug 551850 - JGit should not modify .gitconfig with "[filesystem]" "timestampResolution"
Summary: JGit should not modify .gitconfig with "[filesystem]" "timestampResolution"
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X
: P3 normal with 2 votes (vote)
Target Milestone: 5.5.2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-07 08:19 EDT by Missing name CLA
Modified: 2019-11-12 02:31 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Missing name CLA 2019-10-07 08:19:18 EDT
After upgrading to Eclipse 2019-09, I found the following mysterious stanzas appended to my hand-crafted $HOME/.gitconfig file:

[filesystem "Oracle Corporation|13|/dev/disk1s1"]
	timestampResolution = 15000 nanoseconds
	minRacyThreshold = 0 nanoseconds

Apparently this is written by JGit, as I found references to these gitconfig key strings in org.eclipse.jgit/src/org/eclipse/jgit/util/FS.java 

In my opinion, JGit should not modify handcrafted .gitconfig files without prompting the user for permission. That's quite rude, to be honest!

Keeping .gitconfig in sync between multiple machines is now made more difficult by JGit adding machine-specific configurations without keying them on the machine name.

Can this configuration value please be moved into a JGit or Eclipse specific configuration file and kept out of $HOME/.gitconfig?

At the very least, the automatically written value should contain an identifying attribution to JGit so users can understand why there is suddenly an undocumented "Oracle Corporation|13|/dev/disk1s1" configuration entry in $HOME/.gitconfig. Using a hostname or machineID in the key would probably also be a good choice, since many machines may have a /dev/disk1s1 and .gitconfig files may very well be shared and synced between multiple machines.

But really, please try to stay out of handcrafted $HOME/.gitconfig files.
Comment 1 Eclipse Genie CLA 2019-10-07 13:14:16 EDT
New Gerrit change created: https://git.eclipse.org/r/150740
Comment 2 Eclipse Genie CLA 2019-10-07 13:14:18 EDT
New Gerrit change created: https://git.eclipse.org/r/150739
Comment 3 Eclipse Genie CLA 2019-10-07 13:15:41 EDT
New Gerrit change created: https://git.eclipse.org/r/150742
Comment 4 Ian Young CLA 2019-10-09 10:29:32 EDT
+1 on not wanting silent changes to my curated and centrally distributed .gitconfig

-1 on solutions which address this just by adding the machine name; that doesn't help me at all

It's also perhaps worth noting that I'm using a "dotfiles"-type system in which ~/.gitconfig is actually a symbolic link to a file in a separate Git repository. Replacing the symbolic link with a new modified file as the current code appears to also prevents incoming changes so it is doubly problematic.

By all means allow the user's .gitconfig to override your locally derived values if you really think of this as configuration. But if the main reason to stash this information in the configuration file is to just persist it across invocations, that's more cache than configuration and it belongs elsewhere.
Comment 5 Thomas Wolf CLA 2019-11-05 06:45:28 EST
BTW: writing this data into the user config is also confusing for beginners. See https://www.eclipse.org/forums/index.php/t/1101176/ Open the Word doc attached there, it contains a screenshot. I can fully understand that the user got confused!
Comment 6 Eclipse Genie CLA 2019-11-06 08:45:23 EST
New Gerrit change created: https://git.eclipse.org/r/152141
Comment 7 Eclipse Genie CLA 2019-11-06 08:45:26 EST
New Gerrit change created: https://git.eclipse.org/r/152140
Comment 8 Eclipse Genie CLA 2019-11-10 12:35:57 EST
Gerrit change https://git.eclipse.org/r/150740 was merged to [stable-5.5].
Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=e102bbed995f0e6d3a1a8e5db6d08f9804fd3260
Comment 9 Eclipse Genie CLA 2019-11-10 12:36:06 EST
Gerrit change https://git.eclipse.org/r/150739 was merged to [stable-5.5].
Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=838b5a84b5093c335b95a644b8888006d9e95493
Comment 10 Eclipse Genie CLA 2019-11-12 02:31:30 EST
Gerrit change https://git.eclipse.org/r/150742 was merged to [stable-5.5].
Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=756b57d04ae946338c129ae5cb87b4975d189446