DESCRIPTION

Add support for editing the system wide configuration file

Change the configuration editor into two tabs, one for the user
settings and the other for system settings.

Bug 333216
Change-Id: I60129096a58a74e4c21ee30f04d17c8cd650bded
Signed-off-by: Juliet Cantu xxx@xxx.xxx


COMMENTS

author: Juliet Cantu
date: 2010-12-28 19:13:38.000000000

Patch Set 1:

This patch depends on Change-Id: I1bbee9fb123a81714a34a9cc242b92beacfbb4a8

-------------------------------------
author: Douglas Trujillo
date: 2010-12-31 14:06:30.000000000

Patch Set 1: I would prefer that you didn't submit this

looks good, but on my Mac I can't write the system wide configuration (the file didn't exist so far), egit tries to write it to /usr/local/git/etc/gitconfig as I compiled c-git locally. Shouldn't the system wide config end up in /etc/gitconfig ?

The mkdirs() in the first line of LockFile.lock fails silently (return value isn't checked) as this would require sudo-ing to gain root privileges. The createNewFile() on the next line then fails with an IOException :

java.io.IOException: No such file or directory
	at java.io.UnixFileSystem.createFileExclusively(Native Method)
	at java.io.File.createNewFile(File.java:883)
	at org.eclipse.jgit.storage.file.LockFile.lock(LockFile.java:126)
	at org.eclipse.jgit.storage.file.FileBasedConfig.save(FileBasedConfig.java:174)
	at org.eclipse.egit.ui.internal.preferences.ConfigurationEditorComponent.save(ConfigurationEditorComponent.java:130)
	at org.eclipse.egit.ui.internal.preferences.GlobalConfigurationPreferencePage.performOk(GlobalConfigurationPreferencePage.java:120)
...

If I create /usr/local/git/etc/gitconfig manually I still can't save system wide configuration from egit as it doesn't know how to sudo :

java.io.IOException: Permission denied
	at java.io.UnixFileSystem.createFileExclusively(Native Method)
	at java.io.File.createNewFile(File.java:883)
	at org.eclipse.jgit.storage.file.LockFile.lock(LockFile.java:126)
	at org.eclipse.jgit.storage.file.FileBasedConfig.save(FileBasedConfig.java:174)
	at org.eclipse.egit.ui.internal.preferences.ConfigurationEditorComponent.save(ConfigurationEditorComponent.java:130)
	at org.eclipse.egit.ui.internal.preferences.GlobalConfigurationPreferencePage.performOk(GlobalConfigurationPreferencePage.java:120)
	at org.eclipse.jface.preference.PreferencePage.performApply(PreferencePage.java:432)
...

-------------------------------------
author: Juliet Cantu
date: 2011-01-01 20:28:13.000000000

Patch Set 1:

One would think that /etc/gitconfig would be the system wide configuration file. I did that for a while, but found out it wasn't, which is also documented in the man page for git-config.

That you cannot save to a non-writeable file is not something I can do anything about, but the user does get an error message. I can annotate the location and insert a read-only warning

-------------------------------------
