Code Monkey home page Code Monkey logo

Comments (12)

kusma avatar kusma commented on August 20, 2024

This reproduction recipe is not sufficient to reproduce reliably; please come up with a script that does.

from git.

Fr0sT-Brutal avatar Fr0sT-Brutal commented on August 20, 2024

There's no script, this happens when checking out via Windows context menu. Sorry I forgot to mention it.

from git.

kostix avatar kostix commented on August 20, 2024

You seem to not be able to grok what @kusma wanted to communicate to you, so here's an expanded version:

  1. You're using Git from within TortoiseGit (which can be inferred from you "checking out via Windows context menu");

  2. Git for Windows (which you call msysgit) is not TortoiseGit, and if you're about reporting a problem in Git for Windows itself, you have to demonstrate how that problem manifests itself in plain Git for Windows.

  3. The standard way to provide such demonstration is to capture a Git session exhibiting the problem.

To do this, you drop into a shell, cd to your project directory, pefrorm steps 2 through 3 from your original bug report then run git branch to show the branch wasn't changed after performing step 3. Then you copy the session text (the commands you type and the output they produce) to the clipboard and paste it here so the devs are able to analyze it.

It might also happen that you will see Git either somehow complaining when not switching branches or actually switching the branch (the exact behaviour depends on whether Git will encounter any conflicts).
This would mean the problem is not with Git but rather with TortoiseGit.

It might also happen that Git does complain when switching branches, but, say, fails to return a non-zero exit code, and TortoiseGit (wrongly) decides to not show the output Git produced since it signalized success.

In any case, it's all just guessing. Provide a transcript of your Git session for the further discussion to have any sense.

from git.

Fr0sT-Brutal avatar Fr0sT-Brutal commented on August 20, 2024

Ok, guys, I got it.
Installed http://msysgit.googlecode.com/files/Git-1.7.11-preview20120710.exe on a fresh machine (NO Tortoise or other VCS clients).
Here's the script

md c:\tmp
cd c:\tmp
git init
echo lala > test
git add test
git commit -m test
git checkout -b new
git checkout master
echo test2 > test2
git add test2
git commit -m test2
echo test2 again > test2
git checkout new

Here's what I get:

C:\tmp>git init
Initialized empty Git repository in C:/tmp/.git/

C:\tmp>echo lala  1>test

C:\tmp>git add test

C:\tmp>git commit -m test
[master (root-commit) 1205ed8] test
 1 file changed, 1 insertion(+)
 create mode 100644 test

C:\tmp>git checkout -b new
Switched to a new branch 'new'

C:\tmp>git checkout master
Switched to branch 'master'

C:\tmp>echo test2  1>test2

C:\tmp>git add test2

C:\tmp>git commit -m test2
[master af96777] test2
 1 file changed, 1 insertion(+)
 create mode 100644 test2

C:\tmp>echo test2 again  1>test2

C:\tmp>git checkout new
error: Your local changes to the following files would be overwritten by checkou
t:
        test2
Please, commit your changes or stash them before you can switch branches.
Aborting

This is normal, ok.
But now I perform explorer context menu > Git branch > new.
Git silently fails without any error message.

Btw, Tortoise here works fine, i.e. it shows git error in the log.

from git.

kusma avatar kusma commented on August 20, 2024

So everything WORKS when you use Git for Windows, but does not when you use TortoiseGit? Then why are you reporting this to the Git for Windows developers rather than the TortoiseGit developers?

from git.

Fr0sT-Brutal avatar Fr0sT-Brutal commented on August 20, 2024

kusma, you don't understand.
Everything works when using MSysGit via CLI.
Everything works when using MSysGit + Tortoise.
DOESN'T work when using MSysGit via Windows context menu.
This menu (http://i.imgur.com/kYxgI.png) is a MSysGit one, isn't it?

from git.

kostix avatar kostix commented on August 20, 2024

I wonder if that menu option is provided by Git Cheetah.

I never enable its installation and only have the "Git GUI here" context-menu option (I also could have "Git bash here" as well, but I disable this when installing).

You could run regedit.exe and search for the "Git branch" string, exactly -- that would find a registry record for that context menu extension, and in that record you will be able to see the command which gets executed when that menu entry is activated.

from git.

kusma avatar kusma commented on August 20, 2024

Fr0st-Brutal: Thanks for making that clear. It's a Git-Cheetah menu, as kostix points out.

This seems to fix it for me:

diff --git a/common/cheetahmenu.c b/common/cheetahmenu.c
index 8b75c62..a153fe6 100644
--- a/common/cheetahmenu.c
+++ b/common/cheetahmenu.c
@@ -264,7 +264,7 @@ static int menu_branch(struct git_data *this_, UINT id)
    status = exec_program_v(wd, NULL, &err, HIDDENMODE | WAITMODE, argv);

    /* if nothing, terribly wrong happened, show the confirmation */
-   if (-1 != status)
+   if (status)
        /* strangely enough even success message is on stderr */
        debug_git_mbox(err.buf);

from git.

Fr0sT-Brutal avatar Fr0sT-Brutal commented on August 20, 2024

Fine! We finally understood each other.
kusma, the fix will be available in the next release, I guess? I just don't have tools to compile all the stuff myself.

from git.

kusma avatar kusma commented on August 20, 2024

I didn't say that was "the fix", i said it worked for me. The next step is for you to apply this patch and build so you can verify that it works for you too.

from git.

dscho avatar dscho commented on August 20, 2024

@Fr0sT-Brutal see https://github.com/msysgit/msysgit/wiki/GitCheetah

from git.

dscho avatar dscho commented on August 20, 2024

@Fr0sT-Brutal Git for Windows -- and consequentially, Git Cheetah -- is a project that only is what it is because of volunteer-driven efforts. Waiting for others to scratch your itches won't solve them, most of the time.

Unfortunately, it seems that this is exactly such a time.

from git.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.