git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: git@vger.kernel.org
Cc: Jon Nelson <jnelson-git@jamponi.net>
Subject: Re: git-checkout and SUBDIRECTORY_OK='Yes'
Date: Fri, 23 Dec 2005 09:56:16 -0800	[thread overview]
Message-ID: <7vwthv7l4v.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: 7virtge7fb.fsf@assigned-by-dhcp.cox.net

Junio C Hamano <junkio@cox.net> writes:

> Jon Nelson <jnelson-git@jamponi.net> writes:
>
>> Is it safe to set SUBDIRECTORY_OK='Yes' in git-checkout.sh?

> This patch *might* work, or it may not...

I've done some tests and it seems to work (it is in the
proposed updates branch).

In git.git working tree, here is what happens:

	$ git checkout pu			;# start from pu
        $ cd Documentation
        $ echo >>git-daemon.txt			;# smudge
        $ git checkout -- git-daemon.txt	;# restore
	$ git diff -r --name-status		;# no change
        $ git checkout master git-daemon.txt	;# pick from tree
	$ git diff master -r --name-status	;# (1)
	$ git diff -r --name-status		;# (2)
	$ git diff pu -r --name-status          ;# (3)
        M	Documentation/git-daemon.txt

    (1) does not show any because it did take the file out of master
        branch, and git-daemon.txt is the only file different under
        Documentation/ between master and pu.

    (2) does not show any because "checkout master git-daemon.txt"
        updated the path both in index and working tree.

    (3) shows the path indeed is different between master and pu.

The change relies on ls-tree showing full paths regardless of
where it gets started (because the output is fed to --index-info
form of git-update-index).  If we are going to take the "ls-tree
prefix truncation" patch from Linus, either we also need to
update "git-update-index --index-info" to match this.

      reply	other threads:[~2005-12-23 17:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-23  4:20 git-checkout and SUBDIRECTORY_OK='Yes' Jon Nelson
2005-12-23  4:58 ` Junio C Hamano
2005-12-23 17:56   ` Junio C Hamano [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=7vwthv7l4v.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=jnelson-git@jamponi.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).