<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/credential.c, branch v2.9.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.9.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.9.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-02-26T18:58:14Z</updated>
<entry>
<title>credential: let empty credential specs reset helper list</title>
<updated>2016-02-26T18:58:14Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-02-26T10:51:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=24321375cda79f141be72d1a842e930df6f41725'/>
<id>urn:sha1:24321375cda79f141be72d1a842e930df6f41725</id>
<content type='text'>
Sine the credential.helper key is a multi-valued config
list, there's no way to "unset" a helper once it's been set.
So if your system /etc/gitconfig sets one, you can never
avoid running it, but only add your own helpers on top.

Since an empty value for credential.helper is nonsensical
(it would just try to run "git-credential-"), we can assume
nobody is using it. Let's define it to reset the helper
list, letting you override lower-priority instances which
have come before.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>strbuf: introduce strbuf_getline_{lf,nul}()</title>
<updated>2016-01-15T18:12:51Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-01-13T23:31:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8f309aeb8225a9c26f20c0dbc031f1ea8df75d49'/>
<id>urn:sha1:8f309aeb8225a9c26f20c0dbc031f1ea8df75d49</id>
<content type='text'>
The strbuf_getline() interface allows a byte other than LF or NUL as
the line terminator, but this is only because I wrote these
codepaths anticipating that there might be a value other than NUL
and LF that could be useful when I introduced line_termination long
time ago.  No useful caller that uses other value has emerged.

By now, it is clear that the interface is overly broad without a
good reason.  Many codepaths have hardcoded preference to read
either LF terminated or NUL terminated records from their input, and
then call strbuf_getline() with LF or NUL as the third parameter.

This step introduces two thin wrappers around strbuf_getline(),
namely, strbuf_getline_lf() and strbuf_getline_nul(), and
mechanically rewrites these call sites to call either one of
them.  The changes contained in this patch are:

 * introduction of these two functions in strbuf.[ch]

 * mechanical conversion of all callers to strbuf_getline() with
   either '\n' or '\0' as the third parameter to instead call the
   respective thin wrapper.

After this step, output from "git grep 'strbuf_getline('" would
become a lot smaller.  An interim goal of this series is to make
this an empty set, so that we can have strbuf_getline_crlf() take
over the shorter name strbuf_getline().

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/credential-quit'</title>
<updated>2014-12-22T20:27:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-12-22T20:27:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=86362f7205a31188846de0aed94620c1f0776931'/>
<id>urn:sha1:86362f7205a31188846de0aed94620c1f0776931</id>
<content type='text'>
Credential helpers are asked in turn until one of them give
positive response, which is cumbersome to turn off when you need to
run Git in an automated setting.  The credential helper interface
learned to allow a helper to say "stop, don't ask other helpers."
Also GIT_TERMINAL_PROMPT environment can be set to false to disable
our built-in prompt mechanism for passwords.

* jk/credential-quit:
  prompt: respect GIT_TERMINAL_PROMPT to disable terminal prompts
  credential: let helpers tell us to quit
</content>
</entry>
<entry>
<title>credential: let helpers tell us to quit</title>
<updated>2014-12-04T18:11:12Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-12-04T03:46:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=59b386526a6cdd0289cdf35dd8038ae1bdfd630f'/>
<id>urn:sha1:59b386526a6cdd0289cdf35dd8038ae1bdfd630f</id>
<content type='text'>
When we are trying to fill a credential, we loop over the
set of defined credential-helpers, then fall back to running
askpass, and then finally prompt on the terminal. Helpers
which cannot find a credential are free to tell us nothing,
but they cannot currently ask us to stop prompting.

This patch lets them provide a "quit" attribute, which asks
us to stop the process entirely (avoiding running more
helpers, as well as the askpass/terminal prompt).

This has a few possible uses:

  1. A helper which prompts the user itself (e.g., in a
     dialog) can provide a "cancel" button to the user to
     stop further prompts.

  2. Some helpers may know that prompting cannot possibly
     work. For example, if their role is to broker a ticket
     from an external auth system and that auth system
     cannot be contacted, there is no point in continuing
     (we need a ticket to authenticate, and the user cannot
     provide one by typing it in).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>run-command: introduce CHILD_PROCESS_INIT</title>
<updated>2014-08-20T16:53:37Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2014-08-19T19:09:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d3180279322c7450a47decf8833de47f444ca93f'/>
<id>urn:sha1:d3180279322c7450a47decf8833de47f444ca93f</id>
<content type='text'>
Most struct child_process variables are cleared using memset first after
declaration.  Provide a macro, CHILD_PROCESS_INIT, that can be used to
initialize them statically instead.  That's shorter, doesn't require a
function call and is slightly more readable (especially given that we
already have STRBUF_INIT, ARGV_ARRAY_INIT etc.).

Helped-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refactor skip_prefix to return a boolean</title>
<updated>2014-06-20T17:44:43Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-06-18T19:44:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cf4fff579e02d8585d59f6c8739534b7b0d617dd'/>
<id>urn:sha1:cf4fff579e02d8585d59f6c8739534b7b0d617dd</id>
<content type='text'>
The skip_prefix() function returns a pointer to the content
past the prefix, or NULL if the prefix was not found. While
this is nice and simple, in practice it makes it hard to use
for two reasons:

  1. When you want to conditionally skip or keep the string
     as-is, you have to introduce a temporary variable.
     For example:

       tmp = skip_prefix(buf, "foo");
       if (tmp)
	       buf = tmp;

  2. It is verbose to check the outcome in a conditional, as
     you need extra parentheses to silence compiler
     warnings. For example:

       if ((cp = skip_prefix(buf, "foo"))
	       /* do something with cp */

Both of these make it harder to use for long if-chains, and
we tend to use starts_with() instead. However, the first line
of "do something" is often to then skip forward in buf past
the prefix, either using a magic constant or with an extra
strlen(3) (which is generally computed at compile time, but
means we are repeating ourselves).

This patch refactors skip_prefix() to return a simple boolean,
and to provide the pointer value as an out-parameter. If the
prefix is not found, the out-parameter is untouched. This
lets you write:

  if (skip_prefix(arg, "foo ", &amp;arg))
	  do_foo(arg);
  else if (skip_prefix(arg, "bar ", &amp;arg))
	  do_bar(arg);

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>credential: convert "url" attribute into its parsed subparts</title>
<updated>2012-07-18T20:26:58Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-07-18T12:06:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9c183a70722804114ac1dc54d17fe791ac1a452c'/>
<id>urn:sha1:9c183a70722804114ac1dc54d17fe791ac1a452c</id>
<content type='text'>
The git-credential command requires that you feed it a
broken-down credential, which means that the client needs to
parse a URL itself. Since we have our own URL-parsing
routines, we can easily allow the caller to just give us the
URL as-is, saving them some code.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Acked-by: Matthieu Moy &lt;Matthieu.Moy@imag.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git credential fill: output the whole 'struct credential'</title>
<updated>2012-06-25T18:56:24Z</updated>
<author>
<name>Matthieu Moy</name>
<email>Matthieu.Moy@imag.fr</email>
</author>
<published>2012-06-24T11:40:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2d6dc182b8fa171a6b283ce6e8e75a35e13ea67a'/>
<id>urn:sha1:2d6dc182b8fa171a6b283ce6e8e75a35e13ea67a</id>
<content type='text'>
Instead of outputing only the username and password, print all the
attributes, even those that already appeared in the input.

This is closer to what the C API does, and allows one to take the exact
output of "git credential fill" as input to "git credential approve" or
"git credential reject".

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>credential: use git_prompt instead of git_getpass</title>
<updated>2011-12-13T00:09:39Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2011-12-10T10:41:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ce77aa4813c8a3980283c0a1e760f51f3a405154'/>
<id>urn:sha1:ce77aa4813c8a3980283c0a1e760f51f3a405154</id>
<content type='text'>
We use git_getpass to retrieve the username and password
from the terminal. However, git_getpass will not echo the
username as the user types. We can fix this by using the
more generic git_prompt, which underlies git_getpass but
lets us specify an "echo" option.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>move git_getpass to its own source file</title>
<updated>2011-12-13T00:09:38Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2011-12-10T10:40:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d3c58b83aee2007ca76dc5d1242c09b6f7989c76'/>
<id>urn:sha1:d3c58b83aee2007ca76dc5d1242c09b6f7989c76</id>
<content type='text'>
This is currently in connect.c, but really has nothing to
do with the git protocol itself. Let's make a new source
file all about prompting the user, which will make it
cleaner to refactor.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
