Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I determine the correct git config setting to use in the global config file from an option name?

Tags:

git

I want to use the '--compaction-heuristic' option in my global git config file. It's an option of the git log command:

--compaction-heuristic

--no-compaction-heuristic

These are to help debugging and tuning an experimental heuristic (which is off by default) that shifts the hunk boundary in an attempt to make the resulting patch easier to read.

The git config documentation suggests adding config settings like this example:

git config --global core.editor emacs

There doesn't appear to be anything in the git log documentation that states what this config value should be - so what is it and where would I find the specification that explains the format of the line:

git config --global [magic to enable compaction-heuristic here]

This git feature has now been removed anyway

like image 398
Neil Trodden Avatar asked Jun 15 '16 12:06

Neil Trodden


People also ask

How do I find global git settings?

To see all of properties configured globally in Git, you can use the –list switch on the git config command. Adding the –show-origin switch will also tell you the global .

What is git config --'global user name?

To set your Git username, run the git config –global user.name command. You should specify both your first and last name but your username can be anything you want to attach to your commits. Your Git username does not need to be the same as your version control username, such as the one you use on GitHub.

Which file lets you specify git global configuration settings?

The git config command is a convenience function that is used to set Git configuration values on a global or local project level. These configuration levels correspond to . gitconfig text files. Executing git config will modify a configuration text file.


2 Answers

It seems to be an option under diff.

git config --global diff.compactionHeuristic true

BTW this is an option of git diff.

Reference (diff config): https://github.com/git/git/blob/5580b271af518bae30148edfd42cc8459d8da384/Documentation/diff-config.txt#L169-L172

like image 193
James Chen Avatar answered Oct 21 '22 19:10

James Chen


According to this blog post:

This new heuristic is still experimental, and may change in the future, or even become the default. For now, you can enable it with the --compaction-heuristic option on the command line, or by setting diff.compactionHeuristic in your git config.

If you prefer, you can also create an alias for the git log command with your favorite flags:

git config --global alias.log1 "log --decorate=short --oneline --compaction-heuristic"

And use your new alias:

git log1
like image 41
everton Avatar answered Oct 21 '22 17:10

everton