From: Jeff King <peff@peff.net>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: git@vger.kernel.org, "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
"Junio C Hamano" <gitster@pobox.com>
Subject: Re: [PATCH 0/4] git --paginate: do not commit pager choice too early
Date: Mon, 28 Jun 2010 06:22:01 -0400 [thread overview]
Message-ID: <20100628102201.GA24817@coredump.intra.peff.net> (raw)
In-Reply-To: <20100628101335.GA5007@burratino>
On Mon, Jun 28, 2010 at 05:13:35AM -0500, Jonathan Nieder wrote:
> > But reading the message for patch 4/4, I can't help but wonder if the
> > right way forward is for the git wrapper to _always_ find the repository
> > as the very first thing.
> [...]
> > the worst case should be a little bit of
> > wasted effort.
>
> This is a very useful thought. Git without the chdir() to toplevel
> would be pleasanter, I think. (Yes, I realize you weren’t necessarily
> suggesting suppressing a chdir_to_toplevel() in place of
> setup_git_repository() and friends.)
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.
> Regarding the repository search: automounters can cause pain if
> DISCOVERY_ACROSS_FILESYSTEM is set and GIT_CEILING_DIRECTORIES is not
> set appropriately. An important script that does
>
> tmpdir=$(mktemp -d)
> cd "$tmpdir"
> ...
>
> git diff --no-index a b
> ...
>
> could hang indefinitely if some nut has created a named pipe at
> /tmp/.git. I haven’t come up with any non far-fetched reason to mind
> the repository search, though.
>
> Will think about this.
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
next prev parent reply other threads:[~2010-06-28 10:22 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-26 19:22 [PATCH 0/4] git --paginate: do not commit pager choice too early Jonathan Nieder
2010-06-26 19:23 ` [PATCH 1/4] t7006 (pager): introduce helper for parameterized tests Jonathan Nieder
2010-06-26 19:24 ` [PATCH 2/4] t7006: test pager configuration for several git commands Jonathan Nieder
2010-06-26 19:28 ` Jonathan Nieder
2010-06-26 19:25 ` [PATCH 3/4] tests: local config file should be honored from subdirs of toplevel Jonathan Nieder
2010-06-26 19:26 ` [PATCH 4/4] git --paginate: do not commit pager choice too early Jonathan Nieder
2010-06-28 9:40 ` [PATCH 0/4] " Jeff King
2010-06-28 10:13 ` Jonathan Nieder
2010-06-28 10:22 ` Jeff King [this message]
2010-06-28 12:45 ` Nguyen Thai Ngoc Duy
2010-06-29 5:42 ` Junio C Hamano
2010-07-14 20:36 ` Junio C Hamano
2010-07-14 21:30 ` Jonathan Nieder
2010-07-14 22:55 ` [PATCH] git --paginate: paginate external commands again Jonathan Nieder
2010-07-18 12:27 ` [PATCH 0/4] git --paginate: do not commit pager choice too early Nguyen Thai Ngoc Duy
2010-08-06 2:35 ` [PATCH jn/paginate-fix 0/12] " Jonathan Nieder
2010-08-06 2:40 ` [PATCH 01/12] git wrapper: introduce startup_info struct Jonathan Nieder
2010-08-06 2:46 ` [PATCH 02/12] setup: remember whether repository was found Jonathan Nieder
2010-08-06 2:52 ` [PATCH 03/12] git wrapper: allow setup_git_directory_gently() be called earlier Jonathan Nieder
2010-08-06 3:01 ` [PATCH 04/12] shortlog: run setup_git_directory_gently() sooner Jonathan Nieder
2010-08-06 3:06 ` [PATCH 05/12] grep: " Jonathan Nieder
2010-08-06 3:08 ` [PATCH 06/12] apply: " Jonathan Nieder
2010-08-15 20:13 ` Ævar Arnfjörð Bjarmason
2010-08-15 22:34 ` Nguyen Thai Ngoc Duy
2010-08-15 23:11 ` Jonathan Nieder
2010-08-16 0:36 ` [PATCH 06/12 v2] " Nguyễn Thái Ngọc Duy
2010-08-16 3:39 ` Junio C Hamano
2010-08-06 3:12 ` [PATCH 07/12] bundle: " Jonathan Nieder
2010-08-16 7:21 ` Thomas Rast
2010-08-16 8:07 ` Jonathan Nieder
2010-08-16 8:11 ` [PATCH 2/2] t7006 (pager): add missing TTY prerequisite Jonathan Nieder
2010-08-16 16:41 ` Junio C Hamano
2010-08-06 3:15 ` [PATCH 08/12] config: run setup_git_directory_gently() sooner Jonathan Nieder
2010-08-06 3:18 ` [PATCH 09/12] index-pack: " Jonathan Nieder
2010-08-06 3:20 ` [PATCH 10/12] ls-remote: " Jonathan Nieder
2010-08-06 3:21 ` [PATCH 11/12] var: " Jonathan Nieder
2010-08-06 3:27 ` [PATCH 12/12] merge-file: " Jonathan Nieder
2010-08-06 3:34 ` [PATCH master 0/2] fix "check-ref-format --branch" from subdir of toplevel Jonathan Nieder
2010-08-06 3:36 ` [PATCH 1/2] check-ref-format: handle subcommands in separate functions Jonathan Nieder
2010-08-06 3:39 ` [PATCH 2/2] Allow "check-ref-format --branch" from subdirectory Jonathan Nieder
2010-08-06 19:42 ` Junio C Hamano
2010-08-06 4:26 ` [PATCH jn/paginate-fix 0/12] Re: git --paginate: do not commit pager choice too early Nguyen Thai Ngoc Duy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100628102201.GA24817@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.com \
--cc=pclouds@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).