2011/4/10 Junio C Hamano <gitster@xxxxxxxxx>: > Nguyán ThÃi Ngác Duy <pclouds@xxxxxxxxx> writes: > This assumes that the new API function will default to "if run without > pathspec, the calling command wants to limit to cwd", doesn't it? Yes, I was blindly reimplementing get_pathspec() behavior... > That is why I mentioned that the caller would need to pass a hint as to > what should happen in that case in my earlier message. ÂProbably the new > API function should be something like: > > Â Âsetup_pathspec(&pathspec, prefix, argc, argv, opts) > > where opts is a bitmask to carry that hint (or a pointer to a structure > that caller to carry a set of hints richer than a bitmask can express), > and "add -u" and "grep" should set PATHSPEC_DEFAULT_LOCAL in the bitmask. > The call to setup_pathspec() from the log family would not want "no user > specified pathspec means limited to local" semantics. > > Then when somebody wants to flip the "add -u" default in future versions, > the call from "add -u" codepath can instead use PATHSPEC_DEFAULT_TREEWIDE > (or perhaps the lack of PATHSPEC_DEFAULT_LOCAL bit may mean tree-wide) > there. ... and forgot about this. -- Duy -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html