Re: [PATCH 0/4] git --paginate: do not commit pager choice too early

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jeff King
Date: Monday, June 28, 2010 - 3:22 am

On Mon, Jun 28, 2010 at 05:13:35AM -0500, Jonathan Nieder wrote:


I had just meant that we would not do the chdir() initially, but would
do so right before running the actual command which wanted repository
setup (and commands like init which do not do that setup would never
chdir to the toplevel). But we must always run at least aliases and
external sub-commands from the toplevel to keep backwards compatibility.


Yeah, I considered that, too. But I doubt it is a big problem. If it
were, then just running "git log" when you are not in a repository would
be similarly painful. The people who have setups like that are already
having to deal with GIT_CEILING_DIRECTORIES to make things less painful
(though I imagine the new cross-filesystem discovery code will prevent
most of the pain without them having to actually do anything).

So yes, we are adding the extra lookup for commands like "git clone",
but I suspect in practice nobody will care. If it is a big deal, we can
do something like:

  if (!strcmp(cmd, "clone") || !strcmp(cmd, "init"))
     ... don't do setup ...

which I admit is a terrible hack, but it is an optimization, not a
correctness thing. So we are not shutting out external user-defined
commands that might not care about the repo. We are just making our
common built-in ones a bit more efficient.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 0/4] git --paginate: do not commit pager choice ..., Jeff King, (Mon Jun 28, 3:22 am)
Re: [PATCH 0/4] git --paginate: do not commit pager choice ..., Nguyen Thai Ngoc Duy, (Mon Jun 28, 5:45 am)
[PATCH] git --paginate: paginate external commands again, Jonathan Nieder, (Wed Jul 14, 3:55 pm)
Re: [PATCH 0/4] git --paginate: do not commit pager choice ..., Nguyen Thai Ngoc Duy, (Sun Jul 18, 5:27 am)
[PATCH 01/12] git wrapper: introduce startup_info struct, Jonathan Nieder, (Thu Aug 5, 7:40 pm)
[PATCH 02/12] setup: remember whether repository was found, Jonathan Nieder, (Thu Aug 5, 7:46 pm)
[PATCH 11/12] var: run setup_git_directory_gently() sooner, Jonathan Nieder, (Thu Aug 5, 8:21 pm)
Re: [PATCH jn/paginate-fix 0/12] Re: git --paginate: do no ..., Nguyen Thai Ngoc Duy, (Thu Aug 5, 9:26 pm)
Re: [PATCH 06/12] apply: run setup_git_directory_gently() ..., Ævar Arnfjörð Bjarmason, (Sun Aug 15, 1:13 pm)
Re: [PATCH 06/12] apply: run setup_git_directory_gently() ..., Nguyen Thai Ngoc Duy, (Sun Aug 15, 3:34 pm)
[PATCH 06/12 v2] apply: run setup_git_directory_gently() s ..., =?UTF-8?q?Nguy=E1=BB ..., (Sun Aug 15, 5:36 pm)
[PATCH 2/2] t7006 (pager): add missing TTY prerequisite, Jonathan Nieder, (Mon Aug 16, 1:11 am)