Giter Club home page Giter Club logo

Comments (11)

jakobehn avatar jakobehn commented on July 17, 2024

Thanks Jörg, I'll look into this.

from gitflow.vs.

pcolmer avatar pcolmer commented on July 17, 2024

Unfortunately, the credentials workaround doesn't seem to work if Visual Studio Online is used, perhaps because of the way VSO implements authentication :-(

from gitflow.vs.

joergbattermann avatar joergbattermann commented on July 17, 2024

@pcolmer by default VSO uses (afaik) an OAuth based authentication approach, you can however create and use plain username/password combination, too see e.g. http://www.visualstudio.com/en-us/integrate/get-started/auth/overview how to set them up.

from gitflow.vs.

pcolmer avatar pcolmer commented on July 17, 2024

@jbattermann Thanks for the tip - that fixed it. I've configured git to use the Windows Credentials store, and Windows appears to have remembered my username and password for the VSO URL but it is still prompting me. Not sure why but if I stick to finishing features at the command line, I guess it isn't too big a deal for now.

from gitflow.vs.

jakobehn avatar jakobehn commented on July 17, 2024

I'll see if I can add code to the extension that checks if you are being prompted for credentials, to avoid the blocking issues. But I won't be able to authenticate of course

from gitflow.vs.

pcolmer avatar pcolmer commented on July 17, 2024

@jakobehn Looking at (or perhaps even reading for the first time!) https://msdn.microsoft.com/en-us/library/dd286572.aspx#setup, their recommendation, like @jbattermann, is to use http://gitcredentialstore.codeplex.com/. Although the documentation at https://help.github.com/articles/caching-your-github-password-in-git/ says that msysgit can be configured to store credentials by using "git config --global credential.helper wincred", I couldn't stop it prompting for credentials. gitcredentialstore, on the other hand, not only prompts with a GUI interface (which may solve the blocking problem) but also properly caches the credentials and re-uses them in the future.

It may, therefore, be sufficient to add some more documentation to guide the user through some additional setup steps.

from gitflow.vs.

jakobehn avatar jakobehn commented on July 17, 2024

I just published a new version (0.9.22) that added works around this problem by using a timeout when running git flow. If the timeout hits, a notification message is shown to the user with a suggestion what might be the problem. Unfortunately since git.exe does not output the credentials prompt to stdout, it is quite hard to capture this output properly. If anyone has some info on how to capture the screen buffer please contact me

from gitflow.vs.

yannduran avatar yannduran commented on July 17, 2024

@jakobehn

Does this code give you any clues? Although I notice it's currently using StandardOutput, maybe you could modify the code in some way to achieve what you need to do?

On the other hand, it might be exactly what you've already tried, but I thought I'd put it out there, just in case it helped.

protected static string GetProcessOutput(string name, string args)
{
    try
    {
        //var path = Environment.GetFolderPath(Environment.SpecialFolder.System);
        var p = new Process
        {
            StartInfo =
            {
                UseShellExecute = false,
                RedirectStandardOutput = true,
                FileName = name,
                Arguments=args,
                WindowStyle = ProcessWindowStyle.Hidden
            }
        };
        p.Start();

        // NB: make sure to read to the end of the redirected stream before waiting
        var output = p.StandardOutput.ReadToEnd();

        p.WaitForExit();

        return output;
    }
    catch (Exception ex)
    {
        Console.WriteLine(ex);
        return "";
    }
}

from gitflow.vs.

jakobehn avatar jakobehn commented on July 17, 2024

Thanks Yann, the problem is that when Git prompts for credentials it does not stream it to StdOut, but instead writes directly to the console screen buffer (https://msdn.microsoft.com/en-us/library/windows/desktop/ms682088(v=vs.85).aspx).

Reading from this is quite complicated, the API is pretty low level, so unfortunately I haven't been able to fix this yet.

from gitflow.vs.

joergbattermann avatar joergbattermann commented on July 17, 2024

Jim Mischel wrote an MIT licensed library / sample code to access to screen buffers .. which includes a console buffer reading sample, too. Not sure if you want to pull in external code here, but maybe it's worth a look.

While the article(s) he mentions are no longer available, the sample code still is.

from gitflow.vs.

jakobehn avatar jakobehn commented on July 17, 2024

Thank Jörg, I'll take a look at it! I actually think I found that broken link last time I checked around for implementing screen buffer support, but I didn't find the link to the sample :-)

from gitflow.vs.

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.