git-imerge icon indicating copy to clipboard operation
git-imerge copied to clipboard

Add a class for interacting with git config

Open dleen opened this issue 11 years ago • 2 comments

This commit adds the GitConfigStore class. This allows us to easily get and set keys and values in git config.

The purpose of this class is to enable commands to use git config in a unified manner. The functions to get and set the default imerge name now use this class.

The class is memoized to avoid repeated calls to git config.

Tests pass.

dleen avatar Jun 18 '14 07:06 dleen

Did you get a chance to look at this?

dleen avatar Jun 26 '14 04:06 dleen

If you continue to do memoization of the class constructor, it might make sense to split that into a separate commit to make each change more self-contained. But see my comment above where I express skepticism about whether this memoization is the correct approach. Another unfortunate side-effect of your memoization approach is that GitConfigStore cannot be used as a normal class; for example, if there were a reason to add static methods to the class, it would be impossible to access them.

In summary: I like the idea of having a class for interfacing with git config, but I think that the level of complication could be dialed back a notch or two unless/until we need it.

mhagger avatar Jul 17 '14 17:07 mhagger