From: Junio C Hamano Date: Mon, 14 Mar 2016 17:11:13 GMT Subject: Re: [PATCH] pull: drop confusing prefix parameter of die_on_unclean_work_tree() Message-ID: In-Reply-To: Junio C Hamano writes: > For the purpose of letting "git pull --rebase" make sure that there > is no difference between the index and the working tree, we'd want a > tree-wide diff, so we do not want to limit the diff with pathspec. > Not passing "prefix" to init_revisions() _is_ the right thing. Oh, sorry, I think it is me who uses confusing phrasing, not your reading skills. What I meant by the above was: - We do want tree-wide diff. - We do not want to limit to a subtree. - Passing prefix to init_revisions() mean "if we have pathspec, they are relative to this prefix". - That may hint to the reader that the diff we are going to run may be limited to some subset to the tree, which is not what we are doing. - Hence, we should pass NULL to init_revisions() to make it explicit that we are not limiting. - And the part of your patch to pass NULL to init_revisions() is correct. But the function itself should take prefix, even if it is not going to use it to call init_revisions(), because it makes it possible to do a better reporting later.