threads / patch / 43102

patchRe: [PATCH] Make "git checkout <branch> <path>" work when <path> is a directory.

Subject: Re: [PATCH] Make "git checkout <branch> <path>" work when <path> is a directory.

## tl;dr

4 messages between Nov 17, 2006 and Nov 17, 2006. Diffs are folded; open one to read it.

replies: 3people: 2as markdown or json

Michael K. Edwards· Nov 17, 2006, 05:49 UTC · lore

[PATCH] Make "git checkout <branch> <path>" work when <path> is a directory.

This improves the workflow for, say, kernel subsystem backporting.
Signed-off-by: Michael K. Edwards <medwards-linux@gmail.com>
---
 git-checkout.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Show changes to git-checkout.sh +2 −1
diff --git a/git-checkout.sh b/git-checkout.sh
index dd47724..5866604 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -106,7 +106,8 @@ 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 -- "$@"
+	git-ls-files "$@" |
+	git-checkout-index -f -u --stdin
 	exit $?
 else
 	# Make sure we did not fall back on $arg^{tree} codepath
Junio C Hamano· Nov 17, 2006, 08:15 UTC · re: Michael K. Edwards · lore
"Michael K. Edwards" <medwards.linux@gmail.com> writes:
> Ah.  Missed that patch, which is indeed a superset of mine.  Looks
> like you committed it on branch "next"; is that a personal
> experimental branch, or the integration branch against which patches
> should be generated?

Actually it is not pushed out anywhere yet but will appear on both 'maint' and 'master' along with other post 1.4.4 fixes and will be contained in the 1.4.4.1 maintenance release.

The role of each branch at my public repository is desribed in this message:

	Message-ID: <7vk62qhy4k.fsf@assigned-by-dhcp.cox.net>
	http://article.gmane.org/gmane.comp.version-control.git/29951

In general, if your changes and fixes are applicable in isolation to "master", it is most appropriate to send patches against "master". If you are following up a topic that is cooking in "next" (or "pu"), then basing your patch on "master" is obviously a bad idea and a patch that applies on "next" (or "pu") would be more appropriate. If you can make the patch against the tip of the specific topic that would be even better but it generally is more work for you, so I usually do not ask that to contributors.

← back to recent threads