Commit Graph

142 Commits

Author SHA1 Message Date
Steffen Prohaska
a142ff84ed Merge commit 'mingw/master' into work/merge-mingw 2007-12-28 10:10:45 +01:00
Johannes Sixt
5877600179 MSYS: local clone must use the drive letter in absolute paths.
The default of pwd of MSYS's bash and /bin/pwd are to use /c/rest/of/path
notation instead of c:/rest/of/path. But the former is not supported
by programs that use the standard C runtime (instead of MSYS's
runtime). Hence, we must make sure that only drive letter notations
are generated by using pwd's -W option.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
2007-12-26 19:15:26 +01:00
Steffen Prohaska
95da27bdde Merge commit 'mingw/master' into work/merge-mingw
Conflicts:

	help.c
2007-12-21 08:20:13 +01:00
Johannes Sixt
b852ad8252 Merge branch 'master' of git://repo.or.cz/alt-git to sync with v1.5.4-rc1 2007-12-20 08:32:36 +01:00
Marco Roeland
9d81e03b5c clone: fix options '-o' and '--origin' to be recognised again
Due to a subtle typo in a shell case pattern neither alternative worked.

Signed-off-by: Marco Roeland <marco.roeland@xs4all.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-19 14:59:18 -08:00
Junio C Hamano
bd8ff616c9 Merge branch 'maint'
* maint:
  git-send-email: avoid duplicate message-ids
  clone: correctly report http_fetch errors
2007-12-17 20:49:42 -08:00
Jeff King
6851162adf clone: correctly report http_fetch errors
The exit status from curl was accidentally lost by the
'case' statement. We need to explicitly save it so that $?
doesn't get overwritten.

This improves the error message when fetching from an http
repository which has never had update-server-info run.
Previously, it would fail to note the fetch error and
produce multiple errors about the lack of origin branches.
It now correctly suggests running git-update-server-info.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-17 15:54:28 -08:00
Steffen Prohaska
7b25739391 Merge commit 'mingw/master' into work/merge-mingw
Conflicts:

	Makefile
	help.c
	  moved msysgit specific code to show_html_page
	  and call show_html_page per default.
2007-12-13 22:38:05 +01:00
Johannes Sixt
224244e4ca Merge branch 'master' of git://repo.or.cz/alt-git to sync with v1.5.4-rc0 2007-12-13 20:54:23 +01:00
Charles Bailey
d4110a9726 Fix clone not to ignore depth when performing a local clone
When git-clone detects that it can perform a local clone it
follows a path that silently ignores the depth parameter.

Presumably if the user explicitly requests a shallow clone they
have a reason to prefer a space efficient clone of just the recent
history so bypass the local magic if the user specifies the depth
parameter.

Signed-off-by: Charles Bailey <charles@hashpling.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-12 10:59:22 -08:00
Jeff King
ef4cffde9c git-clone: print an error message when trying to clone empty repo
Previously, cloning an empty repository looked like this:

$ (mkdir parent && cd parent && git --bare init)
$ git-clone parent child
Initialized empty Git repository in /home/peff/clone/child/.git/
$ cd child
-bash: cd: child: No such file or directory
$ echo 'wtf?' | mail git@vger.kernel.org

Now we at least report that the clone was not successful.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-11 11:07:23 -08:00
Steffen Prohaska
9467c5ac39 Merge commit 'mingw/master' into work/merge-mingw
Conflicts:

	Makefile
	git-compat-util.h
2007-12-07 00:45:00 +01:00
Johannes Sixt
757dd70c14 Merge branch 'master' of git://repo.or.cz/alt-git 2007-12-05 19:45:32 +01:00
Johannes Schindelin
3addc94aff Replace instances of export VAR=VAL with VAR=VAL; export VAR
It might be POSIX, but there are shells that do not like the
expression 'export VAR=VAL'.  To be on the safe side, rewrite them
into 'VAR=VAL' and 'export VAR'.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-28 17:23:18 -08:00
Steffen Prohaska
0bac9037f2 Merge commit 'mingw/master' into work/merge-mingw-master-2
Conflicts:

	Makefile
	git-clone.sh
	git-gui/README
	git-gui/git-gui.pot
	git-gui/glossary/Makefile
	git-gui/glossary/de.po
	git-gui/glossary/git-gui-glossary.pot
	git-gui/glossary/git-gui-glossary.txt
	git-gui/glossary/txt-to-pot.sh
	git-gui/glossary/zh_cn.po
	git-gui/lib/commit.tcl
	git-gui/lib/console.tcl
	git-gui/po/README
	git-gui/po/git-gui.pot
	git-gui/po/glossary/Makefile
	git-gui/po/glossary/de.po
	git-gui/po/glossary/git-gui-glossary.pot
	git-gui/po/glossary/git-gui-glossary.txt
	git-gui/po/glossary/txt-to-pot.sh
	git-gui/po/glossary/zh_cn.po
	po/README
	po/git-gui.pot
	po/glossary/Makefile
	po/glossary/de.po
	po/glossary/git-gui-glossary.pot
	po/glossary/git-gui-glossary.txt
	po/glossary/txt-to-pot.sh
	po/glossary/zh_cn.po

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
2007-11-25 14:00:20 +01:00
Johannes Sixt
bfd45616fb Merge branch 'master' of git://repo.or.cz/alt-git 2007-11-24 20:06:27 +01:00
Steffen Prohaska
be5eefb382 Merge commit 'mingw/master' into work/merge-mingw-master
Conflicts:

	Makefile
	builtin-prune-packed.c

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
2007-11-11 10:42:37 +01:00
Pierre Habouzit
e817e3e857 sh-setup: don't let eval output to be shell-expanded.
The previous patch missed the same construct in git-clone.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
2007-11-08 01:49:01 -08:00
Johannes Sixt
97116248a1 Merge branch 'master' of git://repo.or.cz/alt-git 2007-11-06 08:24:22 +01:00
Pierre Habouzit
943625998b Migrate git-clone to use git-rev-parse --parseopt
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-05 22:48:13 -08:00
Steffen Prohaska
69cadd4e60 Merge commit 'mingw/master' into msysgit/merge-mingw-v2
Conflicts:

	Makefile
	RelNotes
	builtin-ls-files.c
	builtin-tag.c
	cache.h
	compat/mingw.c
	config.c
	connect.c
	cpio.sh
	diff.c
	exec_cmd.c
	git-gui/Makefile
	git-gui/lib/commit.tcl
	git-gui/lib/console.tcl
	git-mergetool.sh
	lockfile.c
	path.c
	rsh.c
	run-command.c
	setup.c
	show-index.c
	spawn-pipe.c
	t/Makefile
	t/t0000-basic.sh
	t/t1300-repo-config.sh
	t/t7501-commit.sh
	t/test-lib.sh

    Resolve as follows
    --- Makefile
    - mingw/devel removes
        SHELL_PATH = /bin/sh
        PERL_PATH = /bin/perl

    This looks ok. Both are set early in the Makefile to sensible values.
    mingw accepts to execute /usr/bin/perl.

    - NO_SYMLINKS is no longer needed. Should be auto-detected.

    - According to our 0e2bdc35af
      we want

    NO_R_TO_GCC_LINKER = YesPlease

      take our before their change.

    - Conflict prefix, SCRIPT_SH:
    our 7999f434d7 set prefix =
    their 4a7c98dbaf removes cpio emulator

    resolve to achieve both.

    - Conflict NO_MEMMEM, THREADED_DELTA_SEARCH: take theirs

    --- RelNotes
    take our: removed file

    --- builtin-ls-files.c
    Conflict write_name_quoted: take their change.

    --- builtin-tag.c
    Conflict strip CR

    our 7734ad404c adds strip CR
    their fd17f5b5f7 modifies code to use strbuf

    resolve by removing our code. TODO: we probably need a replacement?

    --- cache.h
    Conflict is_absolute_path()
    our ef5af72062 ifdef
    their 637fc51696 ifndef
    both achieve the same.

    our is a bit more strict but we take their code because we want
    to reduce differences to mingw.

    --- compat/mingw.c
    Conflict at end of file:
    our 194c1dbb5a adds git_exit()

    resolve by taking their first, followed by our.

    --- config.c
    Conflict 'fd ='
    our 0a453a237e merge junio/master
    introduced strange 'fd ='. Resolve by removing 'fd ='.

    --- connect.c
    - Conflict 'host must have at least 2 chars ...' take their code.

    - git_connect(): take their implementation.

    --- cpio.sh
    Accepted their delete file.

    --- diff.c
    Resolve using their implementation.

    --- exec_cmd.c
    Resolve using their implementation.

    --- git-gui/**
    Resolve using our implementation.

    --- git-mergetool.sh
    Resolve using their implementation

    --- lockfile.c
    trivial resolution (empty line removed)

    --- path.c
    Conflict 'tmp': accepting their implementation, trying TMP, TEMP on all platforms.

    --- rsh.c
    Accept their delete file.

    --- run-command.c
    Resolve using their implementation

    --- setup.c
    Resolve using their implementation

    --- show-index.c
    Conflict PRIuMAX
    our 89697a4c15 fix warning
    their 5be507fc95 PRIuMAX

    resolve fixing warning in their code.

    --- spawn-pipe.c
    Conflict environ vs lookup_prog: resolve taking neither

    --- t/Makefile
    our d1f83218dc --no-hardlinks
    their c603988c10 automtically detect symlink support

    Resolve using our --no-hardlinks but removing --no-symlinks.

    --- t/0000-basic.sh
    Resolve using their implementation.

    --- t/t1300-repo-config.sh
    Resolve using their implementation.

    --- t/t7501-commit.sh
    Resolve using their implementation.

    --- t/test-lib.sh
    our d1f83218dc --no-hardlink
    their c603988c10 automatically detect symlink support

    Resolve using our --no-hardlinks but removing --no-symlinks.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
2007-11-05 21:55:44 +01:00
Heikki Orsila
19391c371c git-clone: honor "--" to end argument parsing
Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
2007-11-03 21:44:13 -07:00
Johannes Sixt
fe77ba9245 Merge branch 'master' of git://repo.or.cz/alt-git.git 2007-11-02 21:31:48 +01:00
Aurelien Bompard
1c1f79a1e4 honor the http.sslVerify option in shell scripts
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-28 14:16:59 -07:00
Johannes Sixt
b171dc19ec Implement a cpio emulation inside git-clone.sh for Windows.
We use 'xargs cp' to emulate 'cpio -pumd'.

cpio is fed from the output of 'find --depth' without filtering out
directories. We don't need to copy directories except the empty ones, so
we need to filter out non-empty directories. Then we can use 'cp -r' and
it will not actually recurse anything.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
2007-10-17 21:27:42 +02:00
Johannes Sixt
9b77ca23c4 Merge branch 'maint' of git://repo.or.cz/alt-git 2007-10-13 22:55:28 +02:00
Johannes Sixt
b14adeb12d Undo /usr/bin/sort and /usr/bin/find workarounds. 2007-09-21 21:53:51 +02:00
Johannes Sixt
cd4ce16f0f Work around incompatible sort and find on windows.
If the PATH lists the Windows system directories before the MSYS
directories, Windows's own incompatible sort and find commands would be
picked up. We implement these commands as functions and call the real
tools by absolute path.

Also add a dummy implementation of sync to avoid an error in git-repack.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
2007-09-21 21:53:50 +02:00
Gerrit Pape
f28dd4774d git-clone: improve error message if curl program is missing or not executable
If the curl program is not available (or not executable), and git clone is
started to clone a repository through http, this is the output

 Initialized empty Git repository in /tmp/puppet/.git/
 /usr/bin/git-clone: line 37: curl: command not found
 Cannot get remote repository information.
 Perhaps git-update-server-info needs to be run there?

This patch improves the error message by checking the return code when
running curl to exit immediately if it's 126 or 127; the error output now
is

 Initialized empty Git repository in /tmp/puppet/.git/
 /usr/bin/git-clone: line 37: curl: command not found

Adrian Bridgett noticed this and reported through
 http://bugs.debian.org/440976

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-13 22:39:22 -07:00
Johannes Schindelin
53009e47c2 Merge commit 'v1.5.3' into devel
Conflicts:

	connect.c
	git-clone.sh
	git.c
	t/t5701-clone-local.sh
2007-09-04 00:44:39 +01:00
Johannes Sixt
a703dc4069 Merge branch 'master' of git://repo.or.cz/alt-git 2007-08-29 13:08:45 +02:00
Junio C Hamano
23d53358be git clone: do not issue warning while cloning locally across filesystems
Unless the user explicitly asked hardlinking with the '-l'
option, we should not say "oops we cannot hardlink as you asked
so we are copying".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-20 15:35:15 -07:00
Johannes Sixt
4e83e2adec Merge branch 'master' of git://repo.or.cz/alt-git 2007-08-17 12:24:19 +02:00
Junio C Hamano
312efe9b58 git-clone: allow --bare clone
This is a stop-gap to work around problem with git-init without
intrusive changes.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-15 21:39:07 -07:00
Mike Pape
d1f83218dc Hardlinks are not supported in MSys so we disable them.
We do not want the default to be hardlinks for local clones and we show
a warning if the user tries to use -l.

Signed-off-by: Mike Pape <dotzenlabs@gmail.com>
2007-08-15 13:18:20 -04:00
Marius Storm-Olsen
88d775162b Merge branch 'git_git' into next
Conflicts:

	connect.c
	git-clone.sh
	t/t7004-tag.sh
2007-08-14 09:30:22 +02:00
Johannes Sixt
733bd67d92 Fix mode of shell scripts.
These are the result of mismerges by old Windows versions of git.
2007-08-09 22:32:09 +02:00
Junio C Hamano
3d5c418ff5 git-clone: aggressively optimize local clone behaviour.
This changes the behaviour of cloning from a repository on the
local machine, by defaulting to "-l" (use hardlinks to share
files under .git/objects) and making "-l" a no-op.  A new
option, --no-hardlinks, is also added to cause file-level copy
of files under .git/objects while still avoiding the normal
"pack to pipe, then receive and index pack" network transfer
overhead.  The old behaviour of local cloning without -l nor -s
is availble by specifying the source repository with the newly
introduced file:///path/to/repo.git/ syntax (i.e. "same as
network" cloning).

 * With --no-hardlinks (i.e. have all .git/objects/ copied via
   cpio) would not catch the source repository corruption, and
   also risks corrupted recipient repository if an
   alpha-particle hits memory cell while indexing and resolving
   deltas.  As long as the recipient is created uncorrupted, you
   have a good back-up.

 * same-as-network is expensive, but it would catch the breakage
   of the source repository.  It still risks corrupted recipient
   repository due to hardware failure.  As long as the recipient
   is created uncorrupted, you have a good back-up.

 * The new default on the same filesystem, as long as the source
   repository is healthy, it is very likely that the recipient
   would be, too.  Also it is very cheap.  You do not get any
   back-up benefit, though.

None of the method is resilient against the source repository
corruption, so let's discount that from the comparison.  Then
the difference with and without --no-hardlinks matters primarily
if you value the back-up benefit or not.  If you want to use the
cloned repository as a back-up, then it is cheaper to do a clone
with --no-hardlinks and two git-fsck (source before clone,
recipient after clone) than same-as-network clone, especially as
you are likely to do a git-fsck on the recipient if you are so
paranoid anyway.

Which leads me to believe that being able to use file:/// is
probably a good idea, if only for testability, but probably of
little practical value.  We default to hardlinked clone for
everyday use, and paranoids can use --no-hardlinks as a way to
make a back-up.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-01 23:42:36 -07:00
Johannes Sixt
4613eb6cfd Merge commit 'v1.5.3-rc2' 2007-07-22 21:41:41 +02:00
Johannes Sixt
c78282e3b5 Merge commit '7c851733e4bc2b36bd9df63cab2fe11180242670' 2007-07-21 17:09:51 +02:00
Johannes Sixt
91a4c3a6dd Merge commit '952c8c56380734d45bddf369fe478895672c5a3a' 2007-07-21 16:51:27 +02:00
Matthias Lederhofer
20ccef4968 make git-clone GIT_WORK_TREE aware
If GIT_WORK_TREE is set git-clone will use that path for the
working tree.

Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-05 23:00:50 -07:00
Matthias Lederhofer
68ad8910f7 git-clone: split up long &&-command-chain and use a function for cleanup
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-05 22:52:44 -07:00
Junio C Hamano
5be60078c9 Rewrite "git-frotz" to "git frotz"
This uses the remove-dashes target to replace "git-frotz" to "git frotz".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 22:52:14 -07:00
Junio C Hamano
3b0d9992ee Merge branch 'jo/init'
* jo/init:
  Quiet the output from git-init when cloning, if requested.
  Add an option to quiet git-init.
2007-07-02 21:48:08 -07:00
Sven Verdoolaege
59c93929c8 git-clone: fetch possibly detached HEAD over dumb http
git-clone supports cloning from a repo with detached HEAD,
but if this HEAD is not behind any branch tip then it
would not have been fetched over dumb http, resulting in a

	fatal: Not a valid object name HEAD

Since 928c210a, this would also happen on a http repo
with a HEAD that is a symbolic link where someone has
forgotton to run update-server-info.

Signed-off-by: Sven Verdoolaege <skimo@liacs.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 01:33:44 -07:00
Jeffrey C. Ollie
279050d044 Quiet the output from git-init when cloning, if requested.
Now that git-init has an option to quiet itself, use it if the -q
option was specified on the clone command line.

Signed-off-by: Jeffrey C. Ollie <jeff@ocjtech.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-27 22:22:17 -07:00
Johannes Sixt
ec96b992e0 Merge branch 'maint' of git://repo.or.cz/alt-git 2007-06-25 15:35:36 +02:00
Nanako Shiraishi
6762079a96 Cloning from a repo without "current branch"
If the remote repository does not have a "current branch", git-clone
was confused and did not set up the resulting new repository
correctly.  It did not reset HEAD from the default 'master', and did
not write the SHA1 to the master branch.

Signed-off-by: Nanako Shiraishi <nanako3@bluebottle.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-20 16:33:24 -07:00
Junio C Hamano
52912cce77 Merge branch 'ar/clone'
* ar/clone:
  Fix clone to setup the origin if its name ends with .git
2007-06-08 21:03:04 -07:00