git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Implement --password option for git svn perl script
@ 2010-01-29 14:17 Laszlo Papp
       [not found] ` <001636ed7681994278047e4e4a6f@google.com>
  0 siblings, 1 reply; 16+ messages in thread
From: Laszlo Papp @ 2010-01-29 14:17 UTC (permalink / raw)
  To: git; +Cc: normalperson, lznuaa

Hello,

It would be nice to use --pasword option on windows, like --username
option with git svn facility. I can't handle SVN repository with git
svn on windows if I'd like to authenticate myself with other user than
the default domain name of my windows.

If I use --username option, Frank Li said me it's not enough in
TortoiseGIT to provide a popup facility to type the password related
to the set --username option.

What's your opinion/suggestion/recommendation ?

Best Regards,
Laszlo Papp

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Fwd: Delivery Status Notification (Failure)
       [not found] ` <001636ed7681994278047e4e4a6f@google.com>
@ 2010-01-29 14:18   ` Laszlo Papp
  2010-01-29 15:04     ` Frank Li
  0 siblings, 1 reply; 16+ messages in thread
From: Laszlo Papp @ 2010-01-29 14:18 UTC (permalink / raw)
  To: git; +Cc: normalperson, lznuaa@gmail.com - Chinma/Shanghai/31

Hello,

It would be nice to use --pasword option on windows, like --username
option with git svn facility. I can't handle SVN repository with git
svn on windows if I'd like to authenticate myself with other user than
the default domain name of my windows.

If I use --username option, Frank Li said me it's not enough in
TortoiseGIT to provide a popup facility to type the password related
to the set --username option.

What's your opinion/suggestion/recommendation ?

Best Regards,
Laszlo Papp

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Delivery Status Notification (Failure)
  2010-01-29 14:18   ` Fwd: Delivery Status Notification (Failure) Laszlo Papp
@ 2010-01-29 15:04     ` Frank Li
  2010-02-01 16:16       ` Laszlo Papp
  2010-02-02  4:15       ` Tay Ray Chuan
  0 siblings, 2 replies; 16+ messages in thread
From: Frank Li @ 2010-01-29 15:04 UTC (permalink / raw)
  To: Laszlo Papp; +Cc: git, normalperson

>
> If I use --username option, Frank Li said me it's not enough in
> TortoiseGIT to provide a popup facility to type the password related
> to the set --username option.
>

I prefer git-svn can provide environment to launch a external
application to input password like open ssh.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Delivery Status Notification (Failure)
  2010-01-29 15:04     ` Frank Li
@ 2010-02-01 16:16       ` Laszlo Papp
  2010-02-02  4:15       ` Tay Ray Chuan
  1 sibling, 0 replies; 16+ messages in thread
From: Laszlo Papp @ 2010-02-01 16:16 UTC (permalink / raw)
  To: Frank Li; +Cc: git, normalperson

On Fri, Jan 29, 2010 at 4:04 PM, Frank Li <lznuaa@gmail.com> wrote:
>>
>> If I use --username option, Frank Li said me it's not enough in
>> TortoiseGIT to provide a popup facility to type the password related
>> to the set --username option.
>>
>
> I prefer git-svn can provide environment to launch a external
> application to input password like open ssh.
>

No perl guru among the volunteers if the original author is not available ? :(

Best Regards,
Laszlo Papp

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Delivery Status Notification (Failure)
  2010-01-29 15:04     ` Frank Li
  2010-02-01 16:16       ` Laszlo Papp
@ 2010-02-02  4:15       ` Tay Ray Chuan
  2010-02-02  4:30         ` Frank Li
  1 sibling, 1 reply; 16+ messages in thread
From: Tay Ray Chuan @ 2010-02-02  4:15 UTC (permalink / raw)
  To: Frank Li; +Cc: Laszlo Papp, git, normalperson

Hi,

On Fri, Jan 29, 2010 at 11:04 PM, Frank Li <lznuaa@gmail.com> wrote:
> I prefer git-svn can provide environment to launch a external
> application to input password like open ssh.

how about users who are authenticating over http with basic and
digest? How does one go about launching an external app for password
input in those cases?

Please don't take this as a criticism of your personal preference. I
believe this feature would make things convenient for users who want
it - those who don't, nothing changes.

Even ssh (via ssh-keygen) lets you specify the passphrase at
command-run time. Others include htpasswd, htdigest...

-- 
Cheers,
Ray Chuan

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Delivery Status Notification (Failure)
  2010-02-02  4:15       ` Tay Ray Chuan
@ 2010-02-02  4:30         ` Frank Li
  2010-02-02  6:37           ` Laszlo Papp
  0 siblings, 1 reply; 16+ messages in thread
From: Frank Li @ 2010-02-02  4:30 UTC (permalink / raw)
  To: Tay Ray Chuan; +Cc: Laszlo Papp, git, normalperson

2010/2/2 Tay Ray Chuan <rctay89@gmail.com>:
> Hi,
>
> On Fri, Jan 29, 2010 at 11:04 PM, Frank Li <lznuaa@gmail.com> wrote:
>> I prefer git-svn can provide environment to launch a external
>> application to input password like open ssh.
>
> how about users who are authenticating over http with basic and
> digest? How does one go about launching an external app for password
> input in those cases?

There are not problem if run git svn clone from console.
But a gui application, such tortoisegit, launch "git svn clone" and
capture git svn clone output.
If passwd needed, git svn clone will read character from console but
GUI application don't know that and wait git svn output.
So there are dead lock till timeout and fail.

The same problem has been happen at ssh.  But OpenSSH provide a
option, environment SSH_ASKPASS, which point to a application. when
passwd need, openssh launch this GUI application,  user can input
passwd at this GUI application.

The basic requirement is git svn can provide a way to prompt a dialog
box to input passwd.

Frank Li

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Delivery Status Notification (Failure)
  2010-02-02  4:30         ` Frank Li
@ 2010-02-02  6:37           ` Laszlo Papp
  2010-02-02  9:05             ` Implement --password option for git svn perl script Eric Wong
  0 siblings, 1 reply; 16+ messages in thread
From: Laszlo Papp @ 2010-02-02  6:37 UTC (permalink / raw)
  To: Frank Li; +Cc: Tay Ray Chuan, git, normalperson

> The basic requirement is git svn can provide a way to prompt a dialog
> box to input passwd.

Yeah, it's a very basic use case, but I don't know whether there is a
workaround for it somehow, maybe perl gurus or git svn users could
help more...

My company, where there are windows users (95% of the company), would
like to use TortoiseGIT as a graphical client for SVN server
repositories as an SVN client, no other way by us, so it'd be high
priority :) So I've got a beer for any volunteer, thanks :P

Best Regards,
Laszlo Papp

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Implement --password option for git svn perl script
  2010-02-02  6:37           ` Laszlo Papp
@ 2010-02-02  9:05             ` Eric Wong
  2010-02-02  9:18               ` Frank Li
                                 ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Eric Wong @ 2010-02-02  9:05 UTC (permalink / raw)
  To: Laszlo Papp; +Cc: Frank Li, Tay Ray Chuan, git

Laszlo Papp <djszapi@archlinux.us> wrote:
> > The basic requirement is git svn can provide a way to prompt a dialog
> > box to input passwd.
> 
> Yeah, it's a very basic use case, but I don't know whether there is a
> workaround for it somehow, maybe perl gurus or git svn users could
> help more...
> 
> My company, where there are windows users (95% of the company), would
> like to use TortoiseGIT as a graphical client for SVN server
> repositories as an SVN client, no other way by us, so it'd be high
> priority :) So I've got a beer for any volunteer, thanks :P

Hi, (fixed subject so I don't mistake it for junk again)

I don't know (and have no way to test) how to deal with input dialogs
for reading a password on Windows (nor any sort of IPC).  Somebody else
will have to implement it.

Having a --password option in the command line could work, but it's
painfully insecure if there's any way for another regular user to view
the process table.  Not something I'd like to encourage...

Since SVN already caches passwords in a mostly secure location on disk
(at least on *nix), shouldn't git svn be able to use the password cache
SVN uses?

-- 
Eric Wong

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Implement --password option for git svn perl script
  2010-02-02  9:05             ` Implement --password option for git svn perl script Eric Wong
@ 2010-02-02  9:18               ` Frank Li
  2010-02-02 13:16               ` Laszlo Papp
  2010-02-05 23:01               ` Steve Diver
  2 siblings, 0 replies; 16+ messages in thread
From: Frank Li @ 2010-02-02  9:18 UTC (permalink / raw)
  To: Eric Wong; +Cc: Laszlo Papp, Tay Ray Chuan, git

> Having a --password option in the command line could work, but it's
> painfully insecure if there's any way for another regular user to view
> the process table.  Not something I'd like to encourage...
>

Yes, it is insecure. "--password" seam undocumented.

> Since SVN already caches passwords in a mostly secure location on disk
> (at least on *nix), shouldn't git svn be able to use the password cache
> SVN uses?
>
> --
> Eric Wong
>

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Implement --password option for git svn perl script
  2010-02-02  9:05             ` Implement --password option for git svn perl script Eric Wong
  2010-02-02  9:18               ` Frank Li
@ 2010-02-02 13:16               ` Laszlo Papp
  2010-02-02 23:47                 ` Frank Li
  2010-02-05 23:01               ` Steve Diver
  2 siblings, 1 reply; 16+ messages in thread
From: Laszlo Papp @ 2010-02-02 13:16 UTC (permalink / raw)
  To: Eric Wong; +Cc: Frank Li, Tay Ray Chuan, git

> Since SVN already caches passwords in a mostly secure location on disk
> (at least on *nix), shouldn't git svn be able to use the password cache
> SVN uses?

@Frank Li
@Eric Wong

Maybe you can check whether how TortoiseSVN or SVN client code handle
this situation, because it's the same server, but 'just' the client
side is different a little bit, but the same situation happen there in
case TortoiseSVN a popup menu appears when you try to authenticate
yourself.

Second way is to ask on the SVN mailing list, how they use it, or
maybe I'm totally wrong with it :P

Best Regards,
Laszlo Papp

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Implement --password option for git svn perl script
  2010-02-02 13:16               ` Laszlo Papp
@ 2010-02-02 23:47                 ` Frank Li
  2010-02-04  7:45                   ` Laszlo Papp
  0 siblings, 1 reply; 16+ messages in thread
From: Frank Li @ 2010-02-02 23:47 UTC (permalink / raw)
  To: Laszlo Papp; +Cc: Eric Wong, Tay Ray Chuan, git

Is it possible use OpenSSH method to let GUI to input passwd.
environment SSH_ASKPASS, which point to a application. when
passwd need, openssh launch this GUI application,  user can input
passwd at this GUI application.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Implement --password option for git svn perl script
  2010-02-02 23:47                 ` Frank Li
@ 2010-02-04  7:45                   ` Laszlo Papp
  0 siblings, 0 replies; 16+ messages in thread
From: Laszlo Papp @ 2010-02-04  7:45 UTC (permalink / raw)
  To: Frank Li; +Cc: Eric Wong, Tay Ray Chuan, git

On Wed, Feb 3, 2010 at 12:47 AM, Frank Li <lznuaa@gmail.com> wrote:
> Is it possible use OpenSSH method to let GUI to input passwd.
> environment SSH_ASKPASS, which point to a application. when
> passwd need, openssh launch this GUI application,  user can input
> passwd at this GUI application.
>

What do you mean ? Should I install TortoiseGIT with openssh client,
so should I need to choose this option from the 2 facilities ?

Best Regards,
Laszlo Papp

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Implement --password option for git svn perl script
  2010-02-02  9:05             ` Implement --password option for git svn perl script Eric Wong
  2010-02-02  9:18               ` Frank Li
  2010-02-02 13:16               ` Laszlo Papp
@ 2010-02-05 23:01               ` Steve Diver
  2010-02-08  6:29                 ` Laszlo Papp
  2 siblings, 1 reply; 16+ messages in thread
From: Steve Diver @ 2010-02-05 23:01 UTC (permalink / raw)
  To: Eric Wong; +Cc: Laszlo Papp, Frank Li, Tay Ray Chuan, git

On 02/02/2010 09:05, Eric Wong wrote:
>
> Laszlo Papp<djszapi@archlinux.us>  wrote:
>>> The basic requirement is git svn can provide a way to prompt a dialog
>>> box to input passwd.
>>
>> Yeah, it's a very basic use case, but I don't know whether there is a
>> workaround for it somehow, maybe perl gurus or git svn users could
>> help more...
>>
>> My company, where there are windows users (95% of the company), would
>> like to use TortoiseGIT as a graphical client for SVN server
>> repositories as an SVN client, no other way by us, so it'd be high
>> priority :) So I've got a beer for any volunteer, thanks :P
>
> Hi, (fixed subject so I don't mistake it for junk again)
>
> I don't know (and have no way to test) how to deal with input dialogs
> for reading a password on Windows (nor any sort of IPC).  Somebody else
> will have to implement it.
>
> Having a --password option in the command line could work, but it's
> painfully insecure if there's any way for another regular user to view
> the process table.  Not something I'd like to encourage...
>
> Since SVN already caches passwords in a mostly secure location on disk
> (at least on *nix), shouldn't git svn be able to use the password cache
> SVN uses?
>

Tortoise, along with at least one other Windows GUI utilizes the Putty 
suite as a helper app for key chain and password handling, and needs to 
be loaded prior to any SSH operations. Tortoise have gone so far as to 
rewrite plink (Tortoiseplink.exe)so that that a prompt for the password 
is given, but this is undocumented AFAIK.

Otherwise, it is an unfortunate fact that a DOS console session is 
invoked whenever openSSH is used. For the average Windows user this is a 
scary occurrence, and is one of the obstacles that prevents wider casual 
take up of Git on Windows IMHO.

I understand that it comes down to a problem with communication between 
a dialogue and an SSH client via STDOUT. I believe Dscho might have some 
insight into this as it is a recurrent topic on the MsysGit tracker.

Steve

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Implement --password option for git svn perl script
  2010-02-05 23:01               ` Steve Diver
@ 2010-02-08  6:29                 ` Laszlo Papp
  0 siblings, 0 replies; 16+ messages in thread
From: Laszlo Papp @ 2010-02-08  6:29 UTC (permalink / raw)
  To: Steve Diver; +Cc: Eric Wong, Frank Li, Tay Ray Chuan, git

Any workflow in this task ? :((

Best Regards,
Laszlo Papp

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Fwd: Delivery Status Notification (Failure)
       [not found] ` <047d7b3a85a201067604d9a948e8@google.com>
@ 2013-04-06  4:15   ` Drew Gross
  2013-04-06  4:49     ` Jeff King
  0 siblings, 1 reply; 16+ messages in thread
From: Drew Gross @ 2013-04-06  4:15 UTC (permalink / raw)
  To: git

Hello,

I'm am trying to patch git to refuse to commit if there are both staged and
unstaged changes, and I pass the -a flag. I expected this simple addition
to parse_and_validate_options() in commit.c to accomplish most of what I
want:

if (all && s->workdir_dirty)
    die(_("Cannot commit with -a if there are staged and unstaged changes"));

But when compiled, this will commit anyway even with staged and unstaged
files. I think I misunderstanding the workdir_dirty flag. Can someone help
me?

Drew Gross

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Fwd: Delivery Status Notification (Failure)
  2013-04-06  4:15   ` Fwd: Delivery Status Notification (Failure) Drew Gross
@ 2013-04-06  4:49     ` Jeff King
  0 siblings, 0 replies; 16+ messages in thread
From: Jeff King @ 2013-04-06  4:49 UTC (permalink / raw)
  To: Drew Gross; +Cc: git

On Sat, Apr 06, 2013 at 12:15:33AM -0400, Drew Gross wrote:

> I'm am trying to patch git to refuse to commit if there are both staged and
> unstaged changes, and I pass the -a flag. I expected this simple addition
> to parse_and_validate_options() in commit.c to accomplish most of what I
> want:
> 
> if (all && s->workdir_dirty)
>     die(_("Cannot commit with -a if there are staged and unstaged changes"));
> 
> But when compiled, this will commit anyway even with staged and unstaged
> files. I think I misunderstanding the workdir_dirty flag. Can someone help
> me?

I am not sure if that is a good safety measure in general. But
ignoring that question for a moment, there are a few issues with your
proposed implementation:

  1. workdir_dirty only talks about unstaged changes; it sounds like you
     want to check for both staged and unstaged.

  2. no flags in in the wt_status struct are set until wt_status_collect
     is called; you need to put your check later. But of course by the
     time we call it, we have already updated the index, so you would
     not know anymore which changes were already in the index and which
     were added by "-a".

  3. we do not always run wt_collect_status (e.g., if you are not going
     to run an editor, we do not bother going to the effort to create
     the commit template).

So you'd probably need something more like this:

diff --git a/builtin/commit.c b/builtin/commit.c
index 4620437..ebb5480 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1061,6 +1061,10 @@ static int parse_and_validate_options(int argc, const char *argv[],
 	if (status_format != STATUS_FORMAT_NONE)
 		dry_run = 1;
 
+	wt_status_collect(s);
+	if (all && s->change.nr && s->workdir_dirty)
+		die("Cannot use '-a' with staged and unstaged changes");
+
 	return argc;
 }
 

Note that this may run the diff-index and diff-files procedures twice
(once here, and once later if we actually call run_status). If were
doing this for real (and I do not think it is something we want to take
upstream anyway), you would want to make sure that information was
cached.

-Peff

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2013-04-06 16:59 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-29 14:17 Implement --password option for git svn perl script Laszlo Papp
     [not found] ` <001636ed7681994278047e4e4a6f@google.com>
2010-01-29 14:18   ` Fwd: Delivery Status Notification (Failure) Laszlo Papp
2010-01-29 15:04     ` Frank Li
2010-02-01 16:16       ` Laszlo Papp
2010-02-02  4:15       ` Tay Ray Chuan
2010-02-02  4:30         ` Frank Li
2010-02-02  6:37           ` Laszlo Papp
2010-02-02  9:05             ` Implement --password option for git svn perl script Eric Wong
2010-02-02  9:18               ` Frank Li
2010-02-02 13:16               ` Laszlo Papp
2010-02-02 23:47                 ` Frank Li
2010-02-04  7:45                   ` Laszlo Papp
2010-02-05 23:01               ` Steve Diver
2010-02-08  6:29                 ` Laszlo Papp
     [not found] <CAECh7fANnQDfSNHvOUH7AhyVNciypCKLXadY-jFxso4etCuvrg@mail.gmail.com>
     [not found] ` <047d7b3a85a201067604d9a948e8@google.com>
2013-04-06  4:15   ` Fwd: Delivery Status Notification (Failure) Drew Gross
2013-04-06  4:49     ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).