Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

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

Closed
wants to merge 4 commits into from
Closed

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

wants to merge 4 commits into from

Conversation

cloudchou
Copy link

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

if we right click git gui in the git repository directory (技术), it will tell No working directory.
@buildhive
Copy link

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

@cloudchou
Copy link
Author

so ?

@cloudchou
Copy link
Author

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
Copy link
Author

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

@buildhive
Copy link

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

@cloudchou
Copy link
Author

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

@cloudchou
Copy link
Author

failed 7 among 51 test(s)

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

@buildhive
Copy link

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

@kblees
Copy link

kblees commented Feb 25, 2015

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
Copy link
Author

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
Copy link
Author

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
Copy link

kblees commented Feb 26, 2015

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
Copy link
Author

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

@cloudchou
Copy link
Author

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

@cloudchou
Copy link
Author

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

But we can use file to save the output. then reencode it for tcl.
@kblees
Copy link

kblees commented Feb 26, 2015

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
Copy link
Author

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

@kblees
Copy link

kblees commented Feb 26, 2015

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

@cloudchou
Copy link
Author

Okay. I will revert the changes.

@cloudchou
Copy link
Author

@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
Copy link

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

@cloudchou
Copy link
Author

@kblees this pull request can be close now. there is a new pull request:
#323

@kusma kusma closed this Mar 6, 2015
@dscho
Copy link
Member

dscho commented Mar 6, 2015

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants