Re: [PATCH_v1] add 'git credential' plumbing command

3 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH_v1] add 'git credential' plumbing command

From: Matthieu Moy <hidden>
Date: 2016-06-15 22:54:01

Junio C Hamano [off-list ref] writes:
quoted
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)?
It shouldn't (hence, should use RUN_SETUP_GENTLY).
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.
("git clone" might not be the best example, as the authentication is
usually done in the "git fetch" part of "git clone", but never mind)

Actually, "git credential" has very little to do with Git, and could
even be used in a git-unrelated script.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

Re: [PATCH_v1] add 'git credential' plumbing command

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:54:01

Matthieu Moy wrote:
Junio C Hamano [off-list ref] writes:
quoted
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)?
It shouldn't (hence, should use RUN_SETUP_GENTLY).
Rather, that means it should use 0:

			{ "credential", cmd_credential },

[...]
Actually, "git credential" has very little to do with Git, and could
even be used in a git-unrelated script.
I suspect it would be simplest to make it a non-builtin.  There are
some examples to take inspiration from in the PROGRAM_OBJS variable of
the Makefile.

Hope that helps,
Jonathan

Re: [PATCH_v1] add 'git credential' plumbing command

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:54:01

Jonathan Nieder wrote:
Matthieu Moy wrote:
quoted
Junio C Hamano [off-list ref] writes:
quoted
quoted
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)?
It shouldn't (hence, should use RUN_SETUP_GENTLY).
Rather, that means it should use 0:

			{ "credential", cmd_credential },
... and it turns out I'm talking nonsense.  RUN_SETUP_GENTLY would
be a sensible choice indeed, to allow the command to discover the
current repository and read .git/config from there indeed.

Sorry for the confusion,
Jonathan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help