Re: [PATCH v2 11/19] pull: check if in unresolved merge state

2015-06-14 Thread Paul Tan
On Thu, Jun 11, 2015 at 1:14 AM, Junio C Hamano wrote: > I (or at least some part of me) actually view git_config_get_*() as > "if you are only going to peek a few variables, you do not have to > do the looping yourself" convenience, which leads me (or at least > that part of me) to say "if you ar

Re: [PATCH v2 11/19] pull: check if in unresolved merge state

2015-06-10 Thread Junio C Hamano
Paul Tan writes: > On Wed, Jun 10, 2015 at 10:38 PM, Junio C Hamano wrote: >>> If you are going to do the git_config() call yourself, it might make >>> more sense to define git_pull_config() callback and parse the pull.ff >>> yourself, updating the use of the lazy git_config_get_value() API you

Re: [PATCH v2 11/19] pull: check if in unresolved merge state

2015-06-10 Thread Paul Tan
On Wed, Jun 10, 2015 at 10:38 PM, Junio C Hamano wrote: > Junio C Hamano writes: > >> Paul Tan writes: >> >>> @@ -422,6 +423,14 @@ int cmd_pull(int argc, const char **argv, const char >>> *prefix) >>> >>> parse_repo_refspecs(argc, argv, &repo, &refspecs); >>> >>> +git_config(git_defaul

Re: [PATCH v2 11/19] pull: check if in unresolved merge state

2015-06-10 Thread Junio C Hamano
Junio C Hamano writes: > Paul Tan writes: > >> @@ -422,6 +423,14 @@ int cmd_pull(int argc, const char **argv, const char >> *prefix) >> >> parse_repo_refspecs(argc, argv, &repo, &refspecs); >> >> +git_config(git_default_config, NULL); >> + >> +if (read_cache_unmerged()) >> +

Re: [PATCH v2 11/19] pull: check if in unresolved merge state

2015-06-09 Thread Junio C Hamano
Paul Tan writes: > @@ -422,6 +423,14 @@ int cmd_pull(int argc, const char **argv, const char > *prefix) > > parse_repo_refspecs(argc, argv, &repo, &refspecs); > > + git_config(git_default_config, NULL); > + > + if (read_cache_unmerged()) > + die_resolve_conflict("Pu

[PATCH v2 11/19] pull: check if in unresolved merge state

2015-06-02 Thread Paul Tan
Since d38a30d (Be more user-friendly when refusing to do something because of conflict., 2010-01-12), git-pull will error out with user-friendly advices if the user is in the middle of a merge or has unmerged files. Re-implement this behavior. While the "has unmerged files" case can be handled by