git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>, Jeff King <peff@peff.net>,
	Junio C Hamano <gitster@pobox.com>, Johannes Sixt <j6t@kdbg.org>
Subject: Re: [PATCH 8/9] builtin: check pager.<cmd> configuration if  RUN_SETUP_GENTLY is used
Date: Thu, 15 Apr 2010 19:43:49 +0200	[thread overview]
Message-ID: <q2rfcaeb9bf1004151043v5a8e5634z159b6fa01f859f7e@mail.gmail.com> (raw)
In-Reply-To: <20100415084925.GA14660@progeny.tock>

On Thu, Apr 15, 2010 at 10:49 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> FWIW, my latest is at
>
>  git://repo.or.cz/git/jrn nd/setup/chapter-one
>
> Changes since the last series I sent to the list:
>
>  - test cleanups, after Junio’s feedback
>  - clarified commit messages, I hope
>
> If you’ve already started cleaning up or if something in the diff looks
> iffy, feel free to carry on with what you have.  I don’t want the test
> changes to interfere with more productive work.
>
> Looking forward to watching this evolve,

OK. Here is the topic breakdown into 11 sub-topics, after rebasing on
setup/chapter-one. Patches 1, 2-3, 4-5, 8-9, 10-12, 13-18 can go as
separate independent sub-topics, given that chapter-one is accepted.
The rest must go in sequence because they will need some of previous
groups. Commit messages aren't cleaned up yet, just the idea of
grouping.

Patches available at git://repo.or.cz/git/pclouds.git tp/setup

     1	rev-parse --git-dir: print relative gitdir correctly

This will become a problem when patches 37-43 (let's name it
"unset_git_directory") is merged. Other than that, it's can go alone.

     2	worktree setup: calculate prefix even if no worktree is found
     3	index-pack: trust the prefix returned by setup_git_directory_gently()

This is debatable, as you pointed out, because it changes "git
rev-parse --show-prefix" behavior. This is a prerequisite for 19-36
(run-setup-gently)

     4	Move enter_repo() to setup.c
     5	enter_repo(): initialize other variables as
setup_git_directory_gently() does

Good thing. Quite simple. Prerequisite for 6-7 (have_run_setup)

     6	builtin: remember whether repository has been searched for
     7	builtins: setup repository before print unknown command error

Introduce startup_info->have_run_setup_gitdir, and a guard in command
error printing.

     8	setup: save prefix (original cwd relative to toplevel) in startup_info
     9	builtin: remove prefix variable from run_builtin()

Introduce startup_info->prefix. Will be needed for 47-48 (alias fix)
because setup_git_dir may be called in one place, and unset_git_dir is
called in another place.

    10	run_builtin(): save "-h" detection result for later use
    11	builtins: utilize startup_info->help where possible
    12	builtins: check for startup_info->help, print and exit early

Fix "git cmd -h" shortcut. There will be warnings from git_config()
once the old "guard unallowed access" patch is in. It will be fixed in
patch 45.

    13	init/clone: turn on startup->have_repository properly
    14	t7002: test git grep --no-index from a bare repository
    15	Do not read .git/info/exclude if there is no repository
    16	Do not read .git/info/attributes if there is no repository
    17	apply: do not check sha1 if there is no repository
    18	config: do not read .git/config if there is no repository

Assorted fixes wrt unconditional access to .git/. All these patches
simple add "if (have_repository)" or so.

    19	t0001: test git init when run via an alias
    20	t5512: test that ls-remote does not require a git repository
    21	t7006: expose test_terminal() for use by other tests
    22	help: note why it is appropriate for this command not to use
RUN_SETUP_GENTLY
    23	hash-object: use RUN_SETUP_GENTLY
    24	shortlog: use RUN_SETUP_GENTLY
    25	grep: use RUN_SETUP_GENTLY
    26	archive: use RUN_SETUP_GENTLY
    27	mailinfo: use RUN_SETUP_GENTLY
    28	check-ref-format: use RUN_SETUP_GENTLY
    29	verify-pack: use RUN_SETUP_GENTLY
    30	apply: use RUN_SETUP_GENTLY
    31	bundle: use RUN_SETUP_GENTLY
    32	diff: use RUN_SETUP_GENTLY
    33	ls-remote: use RUN_SETUP_GENTLY
    34	var: use RUN_SETUP_GENTLY
    35	merge-file: use RUN_SETUP_GENTLY
    36	index-pack: use RUN_SETUP_GENTLY

The RUN_SETUP_GENTLY series. Of course these will need to be reviewed,
some commands might need finer-grain setup.

    37	Add git_config_early()
    38	t1300: test that scripted commands do not respect stray .git/config
    39	git_config(): do not read .git/config if there is no repository
    40	Use git_config_early() instead of git_config() during repo setup
    41	worktree setup: call set_git_dir explicitly
    42	worktree setup: restore original state when things go wrong
    43	Allow to undo setup_git_directory_gently() gracefully (and fix
alias code)

The unset_git_directory series. Make setup_git_directory() work right.

    44	Guard unallowed access to repository when it's not set up
    45	run_builtin: do now raise alarms
    46	setup_work_tree: do not raise alarm

Put unallowed access warnings in place. Also fixes false alarms.

    47	alias: keep repository found while collecting aliases as long as possible
    48	run_builtin: respect have_run_setup_gitdir

Fix alias related setup problem.

Insane?
-- 
Duy

  parent reply	other threads:[~2010-04-15 17:43 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-13  2:11 [PATCH/RFC 0/9] Setup cleanup, chapter one Jonathan Nieder
2010-04-13  2:13 ` [PATCH 1/9] t7006: GIT_DIR/config should be honored in subdirs of toplevel Jonathan Nieder
2010-04-14 20:50   ` Junio C Hamano
2010-04-15  0:38     ` [PATCH] t7006: guard cleanup with test_expect_success Jonathan Nieder
2010-04-15  0:56       ` Junio C Hamano
2010-04-15  1:27         ` Jonathan Nieder
2010-04-13  2:17 ` [PATCH 2/9] t7006: test pager configuration for several git commands Jonathan Nieder
2010-04-13  6:34   ` Johannes Sixt
2010-04-13 22:07     ` Jonathan Nieder
2010-04-14  1:26   ` [PATCH 2/9 v2] " Jonathan Nieder
2010-04-13  2:24 ` [PATCH 3/9] builtins: do not commit pager choice early Jonathan Nieder
2010-04-14  2:17   ` [PATCH 3/9 v2] " Jonathan Nieder
2010-04-13  2:25 ` [PATCH 4/9] t7006: test pager.<cmd> configuration Jonathan Nieder
2010-04-14  2:19   ` [PATCH 4/9 v2] " Jonathan Nieder
2010-04-13  2:27 ` [PATCH 5/9] builtin: introduce startup_info struct Jonathan Nieder
2010-04-13  2:28 ` [PATCH 6/9] builtin: remember whether repository was found Jonathan Nieder
2010-04-13  2:29 ` [PATCH 7/9] builtin: Support RUN_SETUP_GENTLY to set up repository early if found Jonathan Nieder
2010-04-13  2:30 ` [PATCH 8/9] builtin: check pager.<cmd> configuration if RUN_SETUP_GENTLY is used Jonathan Nieder
2010-04-13  5:29   ` Nguyen Thai Ngoc Duy
2010-04-14  4:38     ` Jonathan Nieder
2010-04-13 10:12   ` Nguyen Thai Ngoc Duy
2010-04-14  5:06     ` Jonathan Nieder
2010-04-15  8:33       ` Nguyen Thai Ngoc Duy
     [not found]         ` <20100415084925.GA14660@progeny.tock>
2010-04-15 17:43           ` Nguyen Thai Ngoc Duy [this message]
2010-04-13  2:31 ` [PATCH 9/9] config: run setup before commiting pager choice Jonathan Nieder
2010-04-14  2:23   ` [PATCH 9/9 v2] " Jonathan Nieder
2010-04-13  3:08 ` [RFC/PATCH 00/46] nd/setup remainder for convenient reference Jonathan Nieder
2010-04-14  7:59   ` Nguyen Thai Ngoc Duy
2010-04-14 20:54 ` [PATCH/RFC 0/9] Setup cleanup, chapter one Junio C Hamano
2010-04-15  0:05   ` Jonathan Nieder

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=q2rfcaeb9bf1004151043v5a8e5634z159b6fa01f859f7e@mail.gmail.com \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=jrnieder@gmail.com \
    --cc=peff@peff.net \
    /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).