2013/11/5 Andy Bradford:
> In addition  to the  clone/sync/push/pull operations that  you mentioned
> for test cases, we  should also add update/commit/remote-url operations.

I now added the --once option to "fossil clone". I can only think of one
use-case: when cloning a repository where autosync is going to
be off, which is going to be synced automatically using a script
containing "fossil sync --once http://user:passwd@host";. In that
case I can imagine we don't want the url/passwd to be saved.

Currently implemented in "url-passwd-fixes" (at least, this is how
it is expected to work as I understand it):

fossil clone [--once] http://[email protected]
fossil sync [--once] http://[email protected]
fossil pull [--once] http://[email protected]
fossil push [--once] http://[email protected]

     1) When not cloning, if a password is necessary
         and there is a saved password, use the saved
         password.
     2) Otherwise, prompt for a password.
     3) If a password was used which is different
         from the saved password, and no --once
         option is given, prompt whether the
         password should be saved.
     4) Do the actual clone/sync/....
     5) If the clone/sync/... did not succeed because of
         an authentication problem, go to step 2).
         Only repeat this a certain number of times.

fossil clone [--once] http://user:[email protected]
fossil sync [--once] http://user:[email protected]
fossil pull [--once] http://user:[email protected]
fossil push [--once] http://user:[email protected]

     3) If a password was used which is different
         from the saved password, and no --once
         option is given, prompt whether the
         password should be saved.
     4) Do the actual clone/sync/....
     5) If the clone/sync/... did not succeed because of
         an authentication problem, go to step 2).
         Only repeat this a certain number of times.

fossil update
fossil commit
     1) If a password is necessary and there is a saved
         password, use the saved password.
     2) Otherwise, prompt for a password.
     3) If a password was used which is different
         from the saved password, prompt whether
         the password should be saved.
     4) Do the actual update/commit
     5) If the update/commit did not succeed because
         of an authentication problem, go to step 2).
         Only repeat this a certain number of times.

fossil remote-url http://user:[email protected]
     2) If the url contains a user but no password,
         prompt for a password.
     3) If a password was used which is different
         from the saved password, prompt whether
         the password should be saved.
     4) Save the url

> I have  tried to  test as many  of these scenarios  as possible,  but as
> always, more eyes are better.
>
> Thanks for your help.

And many thanks for your implementation!

An improvement would be to delay saving the password
until after the authentication succeeded (except maybe
for "fossil remove-url"). That would prevent people
being asked multiple times whether the password
should be saved, when the first password was wrong.
I tried to look in the code where such change should
be made, but I didn't succeed in that yet. It's not a
big deal, the way it is now is already better than it was!

Regards,
        Jan Nijtmans
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to