git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Baudis <pasky@suse.cz>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-checkout: allow pathspec to recover lost working tree directory
Date: Fri, 17 Nov 2006 16:44:59 +0100	[thread overview]
Message-ID: <20061117154459.GF7201@pasky.or.cz> (raw)
In-Reply-To: <7vbqn8msuw.fsf@assigned-by-dhcp.cox.net>

On Wed, Nov 15, 2006 at 08:07:19PM CET, Junio C Hamano wrote:
> diff --git a/git-checkout.sh b/git-checkout.sh
> index eb28b29..737abd0 100755
> --- a/git-checkout.sh
> +++ b/git-checkout.sh
> @@ -112,7 +112,11 @@ Did you intend to checkout '$@' which ca
>  		git-ls-tree --full-name -r "$new" "$@" |
>  		git-update-index --index-info || exit $?
>  	fi
> -	git-checkout-index -f -u -- "$@"
> +
> +	# Make sure the request is about existing paths.
> +	git-ls-files --error-unmatch -- "$@" >/dev/null || exit
> +	git-ls-files -- "$@" |
> +	git-checkout-index -f -u --stdin
>  	exit $?
>  else
>  	# Make sure we did not fall back on $arg^{tree} codepath

Wouldn't it be better to fix git-checkout-index to checkout a whole
directory if specified?

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1

      parent reply	other threads:[~2006-11-17 15:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-15 19:07 [PATCH] git-checkout: allow pathspec to recover lost working tree directory Junio C Hamano
2006-11-16  1:17 ` Anand Kumria
2006-11-16  2:00   ` Junio C Hamano
2006-11-17 15:44 ` Petr Baudis [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=20061117154459.GF7201@pasky.or.cz \
    --to=pasky@suse.cz \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.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).