From: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH 0/9] setup_git_directory(): return to original cwd upon reaching .git
Date: Sat, 24 Jul 2010 21:45:23 +1000 [thread overview]
Message-ID: <AANLkTik44c_piRQopbK9utUS30E37LnjTMLs_Wp_8TV9@mail.gmail.com> (raw)
In-Reply-To: <20100724111505.GC7150@burratino>
2010/7/24 Jonathan Nieder <jrnieder@gmail.com>:
> Hi Duy,
>
> Nguyễn Thái Ngọc Duy wrote:
>
>> Prefix and cwd should be consistent.
>
> I agree with this, but it took me a while to figure out why your fix
> is safe. Here’s how I figured it out.
>
> Patch 1 cleans up the test script you added a test to. After cleaning
> it up, it is clearer the test does not belong there.
>
> Patch 2 creates a proper home for the new test.
The test was originally to demostrate the breakage and apply was
chosen because it's the first command I found applicable. I doubt if
only "apply" (and index-pack) were affected.
But anyway, more tests can't harm git.
>
> Patches 3-7 split up setup_git_directory_gently() into small enough
> pieces that a person with a short attention span can read it now.
> No functional change intended.
Yeah. I tempted to clean up setup_*_gently too, by splitting the
discovery path ($GIT_DIR check, chdir up...) and the real setup (bunch
of global variables, prefix, check_format, set_git_dir) apart. The was
painful and did not improve readability as much. I gave up.
> Patch 8 is your fix. I removed the comment (which was just confusing
> me) and clarified the commit message to compensate
If that makes it easier to understand, I'm OK.
> Patch 9 is your patch to revert the other, now redundant fix, also
> with commit message tweaks.
>
> After this exercise, your patches still look good. :) Maybe these
> by-products could be useful somehow.
>
> Thoughts (especially improvements) welcome.
--
Duy
prev parent reply other threads:[~2010-07-24 11:45 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-23 12:04 [PATCH 1/2] worktree setup: return to original cwd if prefix is set NULL Nguyễn Thái Ngọc Duy
2010-07-23 12:04 ` [PATCH 2/2] Revert "rehabilitate 'git index-pack' inside the object store" Nguyễn Thái Ngọc Duy
2010-07-23 14:38 ` [PATCH 1/2] worktree setup: return to original cwd if prefix is set NULL Ævar Arnfjörð Bjarmason
2010-07-24 0:50 ` Nguyen Thai Ngoc Duy
2010-07-24 1:16 ` Ævar Arnfjörð Bjarmason
2010-07-23 19:47 ` Nguyễn Thái Ngọc Duy
2010-07-24 11:15 ` [PATCH 0/9] setup_git_directory(): return to original cwd upon reaching .git Jonathan Nieder
2010-07-24 11:16 ` [PATCH 1/9] t1501 (rev-parse): clarify Jonathan Nieder
2010-07-24 11:18 ` [PATCH 2/9] tests: try git apply from subdir of toplevel Jonathan Nieder
2010-07-24 11:19 ` [PATCH 3/9] setup: split off $GIT_DIR-set case from setup_git_directory_gently Jonathan Nieder
2010-07-24 12:15 ` Nguyen Thai Ngoc Duy
2010-07-24 11:20 ` [PATCH 4/9] setup: split off a function to checks working dir for .git file Jonathan Nieder
2010-07-24 11:56 ` Nguyen Thai Ngoc Duy
2010-07-24 12:11 ` Jonathan Nieder
2010-07-24 11:25 ` [PATCH 5/9] setup: split off code to handle stumbling upon a repository Jonathan Nieder
2010-07-24 11:26 ` [PATCH 6/9] setup: split off a function to handle hitting ceiling in repo search Jonathan Nieder
2010-07-24 11:27 ` [PATCH 7/9] setup: split off get_device_or_die helper Jonathan Nieder
2010-07-24 11:29 ` [PATCH 8/9] setup: do not forget working dir from subdir of gitdir Jonathan Nieder
2010-07-24 11:30 ` [PATCH 9/9] Revert "rehabilitate 'git index-pack' inside the object store" Jonathan Nieder
2010-07-24 11:45 ` Nguyen Thai Ngoc Duy [this message]
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=AANLkTik44c_piRQopbK9utUS30E37LnjTMLs_Wp_8TV9@mail.gmail.com \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@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).