On Thu, 16 Nov 2006, Linus Torvalds wrote:Here's a very lightly tested patch that allows you to use "git pull" to populate an empty repository. I'm not at all sure this is necessarily the nicest way to do it, but it's fairly straightforward. Junio, what do you think? Linus --- diff --git a/git-pull.sh b/git-pull.sh index ed04e7d..7e5cee2 100755 --- a/git-pull.sh +++ b/git-pull.sh @@ -44,10 +44,10 @@ do shift done -orig_head=$(git-rev-parse --verify HEAD) || die "Pulling into a black hole?" +orig_head=$(git-rev-parse --verify HEAD 2> /dev/null) git-fetch --update-head-ok --reflog-action=pull "$@" || exit 1 -curr_head=$(git-rev-parse --verify HEAD) +curr_head=$(git-rev-parse --verify HEAD 2> /dev/null) if test "$curr_head" != "$orig_head" then # The fetch involved updating the current branch. @@ -80,6 +80,11 @@ case "$merge_head" in exit 0 ;; ?*' '?*) + if test -z "$orig_head" + then + echo >&2 "Cannot merge multiple branches into empty head" + exit 1 + fi var=`git-repo-config --get pull.octopus` if test -n "$var" then @@ -95,6 +100,12 @@ case "$merge_head" in ;; esac +if test -z "$orig_head" +then + git-update-ref -m "initial pull" HEAD $merge_head "" || exit 1 + exit +fi + case "$strategy_args" in '') strategy_args=$strategy_default_args - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Arjan van de Ven | [patch] Add basic sanity checks to the syscall execution patch |
| Andi Kleen | [PATCH CPA] [1/28] Shrink __PAGE_KERNEL/__PAGE_KERNEL_EXEC on non PAE kernels |
| Alex Dubov | Re: [2.6.20] tifm_7xx1/mmc not working |
| Jared Hulbert | [PATCH 00/10] AXFS: Advanced XIP filesystem |
git: | |
| Junio C Hamano | More precise tag following |
| walt | git versus CVS (versus bk) |
| Stephen R. van den Berg | RFC: grafts generalised |
| Pierre Habouzit | [PATCH 1/2] Add strbuf_cmp. |
| Richard Stallman | Real men don't attack straw men |
| K K | Re: No Blob without Puffy |
| Stephan A. Rickauer | Re: Net-SNMP segfaults under OpenBSD 4.3 |
| Brian A. Seklecki | sshd_config(5) PermitRootLogin yes |
| Jim Winstead Jr. | Re: Root Disk/Book Disk Compatibility |
| Howard Wei-Hao Pan | [Q] Does Linux work with PCMCIA devices? |
| Curtis Yarvin | Re: Problem with UNCOMPRESS |
| Ross Sponholtz | Re: S3 |
