How to determine the correct git configuration parameter to use in the global configuration file from the parameter name?

I want to use the --compaction-heuristic option in my global git configuration file. This is a variant of the git log command:

- sealing-heuristic

- no-sealing-heuristic

This helps debug and tune the experimental heuristic (which is disabled by default), which shifts the hunk border, trying to make reading the resulting patch easier.

The git documentation suggests adding configuration settings similar to this example:

git config --global core.editor emacs

The git log documentation does not contain anything that indicates what should be this configuration value - so what is it and where will I find a specification that explains the format of the string:

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

This git function is now removed anyway

+5
source share
3 answers

This seems to be an option under diff .

 git config --global diff.compactionHeuristic true 

By the way, this is a variant of git diff .

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

+10
source

According to this blog post :

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

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 
+2
source

Git 2.12 Q1 2017 update: the compactionHeuristic parameter is missing.
See " New Git diff compaction heuristics not working .
Git 2.14 Q3 2017 Update: Indentation heuristics are now used by default .


Original answer (for Git 2.9 to 2.11, mid_2016)

Note: with Git 2.9.X / Git 2.10 (Q3 2016), the compactionHeuristic parameter will also be available for git add --interactive .

See commit 46e3d17 (June 16, 2016) by Jeff King ( peff ) .
(Merger of Junio ​​C Hamano - gitster - on commit 054d949 , July 6, 2016

add--interactive : respect diff.compactionHeuristic

" git add -i/-p " learned to appreciate the diff.compactionHeuristic experimental button diff.compactionHeuristic that the user can work with the same section into pieces as the output of << 27>.

We use plumbing to generate diff, so it does not automatically select a user interface configuration, such as compactionHeuristic .
Let me direct it, since the interactive addition is porcelain.

Please note that we only need to handle " true ". No pass --no-compaction-heuristic when the variable is false, since nothing else could have included it.

+1
source

All Articles