{"thread":{"id":"38729","subject":"[PATCH 1/2] Fixes chooser not accepting gitfiles","startedAt":"2015-03-06T16:21:51Z","lastAt":"2015-03-12T21:57:52Z","messageCount":4,"participants":["Remi Rampin","Pat Thoyts"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"257175","messageId":"1425658913-2721-1-git-send-email-remirampin@gmail.com","threadId":"38729","inReplyTo":null,"subject":"[PATCH 0/2] [git-gui] \"Open existing repository\" with submodules","fromName":"Remi Rampin","fromEmail":"remirampin@gmail.com","sentAt":"2015-03-06T16:21:51Z","receivedAt":"2015-03-06T16:21:51Z","isPatch":true,"sender":{"key":"remirampin@gmail.com","avatar":"https://avatars.githubusercontent.com/u/426784?v=4"},"body":"I'm resubmitting this patch series, hopefully someone takes notice\nthis time.\n\nThe GUI cannot currently open a submodule because it fails to recognize\nthe git link file (regular .git file with content \"gitdir: ...\").\n\nPrevious thread:\nhttp://thread.gmane.org/gmane.comp.version-control.git/263199\n\nI'm really not sure if/how git-gui is maintained but I do hope somebody\ncares about this component, that is still AFAIK distributed with Git.\n\nRemi Rampin (2):\n  Fixes chooser not accepting gitfiles\n  Makes chooser set 'gitdir' to the resolved path\n\n lib/choose_repository.tcl | 21 ++++++++++++++++++---\n 1 file changed, 18 insertions(+), 3 deletions(-)\n\n-- \n1.9.5.msysgit.0\n"},{"id":"257173","messageId":"1425658913-2721-2-git-send-email-remirampin@gmail.com","threadId":"38729","inReplyTo":"1425658913-2721-1-git-send-email-remirampin@gmail.com","subject":"[PATCH 1/2] Fixes chooser not accepting gitfiles","fromName":"Remi Rampin","fromEmail":"remirampin@gmail.com","sentAt":"2015-03-06T16:21:52Z","receivedAt":"2015-03-06T16:21:52Z","isPatch":true,"sender":{"key":"remirampin@gmail.com","avatar":"https://avatars.githubusercontent.com/u/426784?v=4"},"body":"Makes _is_git handle the case where the path is a \"gitdir: ...\" file.\n\nSigned-off-by: Remi Rampin <remirampin@gmail.com>\n---\n lib/choose_repository.tcl | 10 ++++++++++\n 1 file changed, 10 insertions(+)\n\ndiff --git a/lib/choose_repository.tcl b/lib/choose_repository.tcl\nindex 92d6022..abc6b1d 100644\n--- a/lib/choose_repository.tcl\n+++ b/lib/choose_repository.tcl\n@@ -339,6 +339,16 @@ method _git_init {} {\n }\n \n proc _is_git {path} {\n+\tif {[file isfile $path]} {\n+\t\tset fp [open $path r]\n+\t\tgets $fp line\n+\t\tclose $fp\n+\t\tif {[regexp \"^gitdir: (.+)$\" $line line link_target]} {\n+\t\t\tset path [file join [file dirname $path] $link_target]\n+\t\t\tset path [file normalize $path]\n+\t\t}\n+\t}\n+\n \tif {[file exists [file join $path HEAD]]\n \t && [file exists [file join $path objects]]\n \t && [file exists [file join $path config]]} {\n-- \n1.9.5.msysgit.0\n"},{"id":"257174","messageId":"1425658913-2721-3-git-send-email-remirampin@gmail.com","threadId":"38729","inReplyTo":"1425658913-2721-1-git-send-email-remirampin@gmail.com","subject":"[PATCH 2/2] Makes chooser set 'gitdir' to the resolved path","fromName":"Remi Rampin","fromEmail":"remirampin@gmail.com","sentAt":"2015-03-06T16:21:53Z","receivedAt":"2015-03-06T16:21:53Z","isPatch":true,"sender":{"key":"remirampin@gmail.com","avatar":"https://avatars.githubusercontent.com/u/426784?v=4"},"body":"If _is_git follows a \"gitdir: ...\" file link to get to the actual\nrepository, we want _gitdir to be set to that final path.\n\nSigned-off-by: Remi Rampin <remirampin@gmail.com>\n---\n lib/choose_repository.tcl | 11 ++++++++---\n 1 file changed, 8 insertions(+), 3 deletions(-)\n\ndiff --git a/lib/choose_repository.tcl b/lib/choose_repository.tcl\nindex abc6b1d..75d1da8 100644\n--- a/lib/choose_repository.tcl\n+++ b/lib/choose_repository.tcl\n@@ -338,7 +338,10 @@ method _git_init {} {\n \treturn 1\n }\n \n-proc _is_git {path} {\n+proc _is_git {path {outdir_var \"\"}} {\n+\tif {$outdir_var ne \"\"} {\n+\t\tupvar 1 $outdir_var outdir\n+\t}\n \tif {[file isfile $path]} {\n \t\tset fp [open $path r]\n \t\tgets $fp line\n@@ -352,12 +355,14 @@ proc _is_git {path} {\n \tif {[file exists [file join $path HEAD]]\n \t && [file exists [file join $path objects]]\n \t && [file exists [file join $path config]]} {\n+\t\tset outdir $path\n \t\treturn 1\n \t}\n \tif {[is_Cygwin]} {\n \t\tif {[file exists [file join $path HEAD]]\n \t\t && [file exists [file join $path objects.lnk]]\n \t\t && [file exists [file join $path config.lnk]]} {\n+\t\t\tset outdir $path\n \t\t\treturn 1\n \t\t}\n \t}\n@@ -1103,7 +1108,7 @@ method _open_local_path {} {\n }\n \n method _do_open2 {} {\n-\tif {![_is_git [file join $local_path .git]]} {\n+\tif {![_is_git [file join $local_path .git] actualgit]} {\n \t\terror_popup [mc \"Not a Git repository: %s\" [file tail $local_path]]\n \t\treturn\n \t}\n@@ -1116,7 +1121,7 @@ method _do_open2 {} {\n \t}\n \n \t_append_recentrepos [pwd]\n-\tset ::_gitdir .git\n+\tset ::_gitdir $actualgit\n \tset ::_prefix {}\n \tset done 1\n }\n-- \n1.9.5.msysgit.0\n"},{"id":"257605","messageId":"87k2yl7uan.fsf@red.patthoyts.tk","threadId":"38729","inReplyTo":"1425658913-2721-1-git-send-email-remirampin@gmail.com","subject":"Re: [PATCH 0/2] [git-gui] \"Open existing repository\" with submodules","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2015-03-12T21:57:52Z","receivedAt":"2015-03-12T21:57:52Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"Remi Rampin <remirampin@gmail.com> writes:\n\n>I'm resubmitting this patch series, hopefully someone takes notice\n>this time.\n>\n>The GUI cannot currently open a submodule because it fails to recognize\n>the git link file (regular .git file with content \"gitdir: ...\").\n>\n>Previous thread:\n>http://thread.gmane.org/gmane.comp.version-control.git/263199\n>\n>I'm really not sure if/how git-gui is maintained but I do hope somebody\n>cares about this component, that is still AFAIK distributed with Git.\n>\n>Remi Rampin (2):\n>  Fixes chooser not accepting gitfiles\n>  Makes chooser set 'gitdir' to the resolved path\n>\n> lib/choose_repository.tcl | 21 ++++++++++++++++++---\n> 1 file changed, 18 insertions(+), 3 deletions(-)\n\nThanks. I've applied these onto git-gui's upstream repository with minor\nchanges to the commit comment to clarify where this becomes useful.\n\n-- \nPat Thoyts                            http://www.patthoyts.tk/\nPGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD\n"}]}