msysgit / git

msysGit-based Git for Windows 1.x is now superseded by Git for Windows 2.x
http://github.com/git-for-windows/git
Other
1.01k stars 316 forks source link

solve the problem : git gui No working directory #302 #321

Closed cloudchou closed 9 years ago

cloudchou commented 9 years ago

solve the problem: if we right click git gui in the git repository directory (技术), it will tell No working directory. issue link: git gui No working directory #302

buildhive commented 9 years ago

MSysGit - the development behind Git for Windows » git #263 FAILURE Looks like there's a problem with this pull request (what's this?)

cloudchou commented 9 years ago

so ?

cloudchou commented 9 years ago

builtin/rev-parse.c:16:19: fatal error: winnt.h: No such file or directory compilation terminated. But I can build it in msys.bat.

cloudchou commented 9 years ago

@dscho now use platform-independent code. BuildHive wil build Okay. Can you deal the pull request?

buildhive commented 9 years ago

MSysGit - the development behind Git for Windows » git #265 FAILURE Looks like there's a problem with this pull request (what's this?)

cloudchou commented 9 years ago

@dscho can you tell me why build hive say there's a problem ?

cloudchou commented 9 years ago

failed 7 among 51 test(s)

but the failed test is not related with the new code.

buildhive commented 9 years ago

MSysGit - the development behind Git for Windows » git #269 SUCCESS This pull request looks good (what's this?)

kblees commented 9 years ago

Could you check if this solves your problem (works for cp1252, but I cannot check cp936):

@@ -526,31 +526,10 @@ proc _lappend_nice {cmd_var} {
 }

 proc git {args} {
-   set opt [list]
-
-   while {1} {
-       switch -- [lindex $args 0] {
-       --nice {
-           _lappend_nice opt
-       }
-
-       default {
-           break
-       }
-
-       }
-
-       set args [lrange $args 1 end]
-   }
-
-   set cmdp [_git_cmd [lindex $args 0]]
-   set args [lrange $args 1 end]
-
-   _trace_exec [concat $opt $cmdp $args]
-   set result [eval exec $opt $cmdp $args]
-   if {[encoding system] != "utf-8"} {
-       set result [encoding convertfrom utf-8 [encoding convertto $result]]
-   }
+   set fd [eval [list git_read] $args]
+   fconfigure $fd -translation binary -encoding utf-8
+   set result [string trimright [read $fd] "\n"]
+   close $fd
    if {$::_trace} {
        puts stderr "< $result"
    }
cloudchou commented 9 years ago

Do you mean add the following code before " if {$::_trace}" ?

 set fd [eval [list git_read] $args]
fconfigure $fd -translation binary -encoding utf-8 
set result [string trimright [read $fd] "\n"]
close $fd

I try it, but it fails.

cloudchou commented 9 years ago

this only for work for git gui command of right key menu. but when use submodule, it will fail. I have to test more

kblees commented 9 years ago

Do you mean add the following code before " if {$::_trace}" ?

Yes, and remove everything else, so that proc git looks like this:

proc git {args} {
    set fd [eval [list git_read] $args]
    fconfigure $fd -translation binary -encoding utf-8
    set result [string trimright [read $fd] "\n"]
    close $fd
    if {$::_trace} {
        puts stderr "< $result"
    }
    return $result
}

but when use submodule, it will fail

Have you tried git gui --trace?

cloudchou commented 9 years ago

Do you have some IM tools? Can we talk in IM ?

cloudchou commented 9 years ago

Okay. I will try it again. wait for a moment.

cloudchou commented 9 years ago

Um. You are right. It works. Thanks very much.

kblees commented 9 years ago

OK, thanks for testing.

So could you please revert the other stuff in the PR? I.e. reset your branch to master, just apply the one commit with the relevant change in git-gui.sh, then push again?

cloudchou commented 9 years ago

Okay. I have pushed it. You can see it now

kblees commented 9 years ago

Hmm...I still see four commits, including unrelated changes in builtin/rev-parse.c, introducing an unused variable etc...

cloudchou commented 9 years ago

Okay. I will revert the changes.

cloudchou commented 9 years ago

@kblees I made a new pull request. Sorry, because I develop on the master branch. And I don't know how to drop the commits on github. So I forked from msysgit again.

buildhive commented 9 years ago

MSysGit - the development behind Git for Windows » git #270 SUCCESS This pull request looks good (what's this?)

cloudchou commented 9 years ago

@kblees this pull request can be close now. there is a new pull request: https://github.com/msysgit/git/pull/323

dscho commented 9 years ago

@cloudchou please do not do this. You can easily update Pull Requests by force-pushing to the same branch. If the description no longer matches the content of the Pull Request, it is easy to edit. Starting a new Pull Request instead of updating the Pull Request just makes it harder to figure out the context of the changes.