Re: [PATCH_v1] add 'git credential' plumbing command
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 10, 2012, 06:53 UTC
- Message-ID
- <7vzk8baca0.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1339267502-13803-1-git-send-email-Javier.Roucher-Iglesias@ensimag.imag.fr>
Javier.Roucher-Iglesias@ensimag.imag.fr writes:
> +Git-credential permits to the user of the script to save: > +username, password, host, path and protocol.
The above sounds like saying "A filesystem allows you to save pathname and contents". While it may not be _wrong_ per-se, usually you would think of a filesystem as something you store contents in; pathname is primarily used as a key to find the contents (i.e. you do not store it in the filesystem).
Isn't the credential mechanism for storing password for <user, protocol, host, path> tuple (i.e. the four-tuple is used as a look-up key)?
Show 15 quoted lines
> diff --git a/builtin/credential.c b/builtin/credential.c
> new file mode 100644
> index 0000000..9f00885
> --- /dev/null
> +++ b/builtin/credential.c
> @@ -0,0 +1,40 @@
> +#include <stdio.h>
> +#include "cache.h"
> +#include "credential.h"
> +#include "string-list.h"
> +
> +static const char usage_msg[] =
> +"credential <fill|approve|reject>";
> +
> +void cmd_credential (int argc, char **argv, const char *prefix){Style:
void cmd_credential(int argc, char **argv, const char *prefix)
{Show 9 quoted lines
> diff --git a/git.c b/git.c
> index d232de9..7cbd7d8 100644
> --- a/git.c
> +++ b/git.c
> @@ -353,6 +353,7 @@ static void handle_internal_command(int argc, const char **argv)
> { "commit-tree", cmd_commit_tree, RUN_SETUP },
> { "config", cmd_config, RUN_SETUP_GENTLY },
> { "count-objects", cmd_count_objects, RUN_SETUP },
> + { "credential", cmd_count_objects, RUN_SETUP },Does "git credential" need to have a git repository (i.e. run in a git repository or in a working tree that is controlled by one)? A scripted Porcelain you would write using "git credential" may want to implement something like "git clone" or "git ls-remote" where you do not have to be in an existing repository.