path: root/
diff options
authorShawn O. Pearce <>2007-09-22 07:47:43 (GMT)
committerShawn O. Pearce <>2007-09-23 08:57:31 (GMT)
commitab08b3630414dfb867825c4a5828438e1c69199d (patch)
treeae28f6641d8723d4ff73754a7bc357ff3aa84d65 /
parenta4bee597134aee9883adba1e79be926a92f80367 (diff)
git-gui: Allow users to choose/create/clone a repository
If we are started outside of a git repository than it is likely the user started us from some sort of desktop shortcut icon in the operating system. In such a case the user is expecting us to prompt them to locate the git repository they want to work on, or to help them make a new repository, or to clone one from an existing location. This is a very simple wizard that offers the user one of these three choices. When we clone a repository we always use the name `master` in the local repository, even if the remote side does not appear to point to that name. I chose this as a policy decision. Much of the Git documentation talks about `master` being the default branch in a repository and that's what git-init does too. If the remote side doesn't call its default branch `master` most users just don't care, they just want to use Git the way the documentation describes. Rather than relying on the git-clone Porcelain that ships with git we build the new repository ourselves and then obtain content by git-fetch. This technique simplifies the entire clone process to roughly: `git init && git fetch && git pull`. Today we use three passes with git-fetch; the first pass gets us the bulk of the objects and the branches, the second pass gets us the tags, and the final pass gets us the current value of HEAD to initialize the default branch. If the source repository is on the local disk we try to use a hardlink to connect the objects into the new clone as this can be many times faster than copying the objects or packing them and passing the data through a pipe to index-pack. Unlike git-clone we stick to pure Tcl [file link -hard] operation thus avoiding the need to fork a cpio process to setup the hardlinks. If hardlinks do not appear to be supported (e.g. filesystem doesn't allow them or we are crossing filesystem boundaries) we use file copying instead. Signed-off-by: Shawn O. Pearce <>
Diffstat (limited to '')
1 files changed, 3 insertions, 3 deletions
diff --git a/ b/
index 3ddfcd5..37da8fd 100755
--- a/
+++ b/
@@ -833,9 +833,9 @@ if {[catch {
set _gitdir [git rev-parse --git-dir]
set _prefix [git rev-parse --show-prefix]
} err]} {
- catch {wm withdraw .}
- error_popup [strcat [mc "Cannot find the git directory:"] "\n\n$err"]
- exit 1
+ load_config 1
+ apply_config
+ choose_repository::pick
if {![file isdirectory $_gitdir] && [is_Cygwin]} {
catch {set _gitdir [exec cygpath --windows $_gitdir]}