<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/remote.h, 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-16T21:33:12Z</updated>
<entry>
<title>remote: simplify remote_is_configured()</title>
<updated>2016-02-16T21:33:12Z</updated>
<author>
<name>Thomas Gummerer</name>
<email>t.gummerer@gmail.com</email>
</author>
<published>2016-02-16T09:47:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=674468b3642abfff7c61d5ff95fffc43b87f70b7'/>
<id>urn:sha1:674468b3642abfff7c61d5ff95fffc43b87f70b7</id>
<content type='text'>
The remote_is_configured() function allows checking whether a remote
exists or not.  The function however only works if remote_get() wasn't
called before calling it.  In addition, it only checks the configuration
for remotes, but not remotes or branches files.

Make use of the origin member of struct remote instead, which indicates
where the remote comes from.  It will be set to some value if the remote
is configured in any file in the repository, but is initialized to 0 if
the remote is only created in make_remote().

Signed-off-by: Thomas Gummerer &lt;t.gummerer@gmail.com&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>http: allow selection of proxy authentication method</title>
<updated>2016-01-26T18:53:09Z</updated>
<author>
<name>Knut Franke</name>
<email>k.franke@science-computing.de</email>
</author>
<published>2016-01-26T13:02:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ef976395e26a25fb6d048d859a1c8cddb2640b9a'/>
<id>urn:sha1:ef976395e26a25fb6d048d859a1c8cddb2640b9a</id>
<content type='text'>
CURLAUTH_ANY does not work with proxies which answer unauthenticated requests
with a 307 redirect to an error page instead of a 407 listing supported
authentication methods. Therefore, allow the authentication method to be set
using the environment variable GIT_HTTP_PROXY_AUTHMETHOD or configuration
variables http.proxyAuthmethod and remote.&lt;name&gt;.proxyAuthmethod (in analogy
to http.proxy and remote.&lt;name&gt;.proxy).

The following values are supported:

* anyauth (default)
* basic
* digest
* negotiate
* ntlm

Signed-off-by: Knut Franke &lt;k.franke@science-computing.de&gt;
Signed-off-by: Elia Pinto &lt;gitter.spiros@gmail.com&gt;
Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Helped-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Helped-by: Elia Pinto &lt;gitter.spiros@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ref_newer: convert to use struct object_id</title>
<updated>2015-11-20T13:02:05Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2015-11-10T02:22:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6f3d57b6e43d6c6f13c94371f16b79fcdece25bc'/>
<id>urn:sha1:6f3d57b6e43d6c6f13c94371f16b79fcdece25bc</id>
<content type='text'>
Convert ref_newer and its caller to use struct object_id instead of
unsigned char *.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
</content>
</entry>
<entry>
<title>Convert struct ref to use object_id.</title>
<updated>2015-11-20T13:02:05Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2015-11-10T02:22:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f4e54d02b894064d370e461385b48701485672bd'/>
<id>urn:sha1:f4e54d02b894064d370e461385b48701485672bd</id>
<content type='text'>
Use struct object_id in three fields in struct ref and convert all the
necessary places that use it.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
</content>
</entry>
<entry>
<title>remote.c: add branch_get_push</title>
<updated>2015-05-22T16:33:08Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-05-21T04:45:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e291c75a95d60862cbe12897b5cffb01ba4cedd5'/>
<id>urn:sha1:e291c75a95d60862cbe12897b5cffb01ba4cedd5</id>
<content type='text'>
In a triangular workflow, the place you pull from and the
place you push to may be different. As we have
branch_get_upstream for the former, this patch adds
branch_get_push for the latter (and as the former implements
@{upstream}, so will this implement @{push} in a future
patch).

Note that the memory-handling for the return value bears
some explanation. Some code paths require allocating a new
string, and some let us return an existing string. We should
provide a consistent interface to the caller, so it knows
whether to free the result or not.

We could do so by xstrdup-ing any existing strings, and
having the caller always free. But that makes us
inconsistent with branch_get_upstream, so we would prefer to
simply take ownership of the resulting string. We do so by
storing it inside the "struct branch", just as we do with
the upstream refname (in that case we compute it when the
branch is created, but there's no reason not to just fill
it in lazily in this case).

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>remote.c: return upstream name from stat_tracking_info</title>
<updated>2015-05-22T16:32:34Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-05-22T00:49:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=979cb245e29b35812d2d71a04069ba7a4580981f'/>
<id>urn:sha1:979cb245e29b35812d2d71a04069ba7a4580981f</id>
<content type='text'>
After calling stat_tracking_info, callers often want to
print the name of the upstream branch (in addition to the
tracking count). To do this, they have to access
branch-&gt;merge-&gt;dst[0] themselves. This is not wrong, as the
return value from stat_tracking_info tells us whether we
have an upstream branch or not. But it is a bit leaky, as we
make an assumption about how it calculated the upstream
name.

Instead, let's add an out-parameter that lets the caller
know the upstream name we found.

As a bonus, we can get rid of the unusual tri-state return
from the function. We no longer need to use it to
differentiate between "no tracking config" and "tracking ref
does not exist" (since you can check the upstream_name for
that), so we can just use the usual 0/-1 convention for
success/error.

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>remote.c: report specific errors from branch_get_upstream</title>
<updated>2015-05-21T18:07:46Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-05-21T04:45:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3a429d0af342d85ef6d561e3a60ae8793a34ae78'/>
<id>urn:sha1:3a429d0af342d85ef6d561e3a60ae8793a34ae78</id>
<content type='text'>
When the previous commit introduced the branch_get_upstream
helper, there was one call-site that could not be converted:
the one in sha1_name.c, which gives detailed error messages
for each possible failure.

Let's teach the helper to optionally report these specific
errors. This lets us convert another callsite, and means we
can use the helper in other locations that want to give the
same error messages.

The logic and error messages come straight from sha1_name.c,
with the exception that we start each error with a lowercase
letter, as is our usual style (note that a few tests need
updated as a result).

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>remote.c: introduce branch_get_upstream helper</title>
<updated>2015-05-21T18:04:42Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-05-21T04:45:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a9f9f8cc1f59104257eb1a11a2d048f54dd92ee6'/>
<id>urn:sha1:a9f9f8cc1f59104257eb1a11a2d048f54dd92ee6</id>
<content type='text'>
All of the information needed to find the @{upstream} of a
branch is included in the branch struct, but callers have to
navigate a series of possible-NULL values to get there.
Let's wrap that logic up in an easy-to-read helper.

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>remote.c: provide per-branch pushremote name</title>
<updated>2015-05-21T18:03:58Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-05-21T04:45:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=da66b2743cf7244e52c4b9d91646b782cd4f7eeb'/>
<id>urn:sha1:da66b2743cf7244e52c4b9d91646b782cd4f7eeb</id>
<content type='text'>
When remote.c loads its config, it records the
branch.*.pushremote for the current branch along with the
global remote.pushDefault value, and then binds them into a
single value: the default push for the current branch. We
then pass this value (which may be NULL) to remote_get_1
when looking up a remote for push.

This has a few downsides:

  1. It's confusing. The early-binding of the "current
     value" led to bugs like the one fixed by 98b406f
     (remote: handle pushremote config in any order,
     2014-02-24). And the fact that pushremotes fall back to
     ordinary remotes is not explicit at all; it happens
     because remote_get_1 cannot tell the difference between
     "we are not asking for the push remote" and "there is
     no push remote configured".

  2. It throws away intermediate data. After read_config()
     finishes, we have no idea what the value of
     remote.pushDefault was, because the string has been
     overwritten by the current branch's
     branch.*.pushremote.

  3. It doesn't record other data. We don't note the
     branch.*.pushremote value for anything but the current
     branch.

Let's make this more like the fetch-remote config. We'll
record the pushremote for each branch, and then explicitly
compute the correct remote for the current branch at the
time of reading.

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>remote.c: hoist branch.*.remote lookup out of remote_get_1</title>
<updated>2015-05-21T18:03:49Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-05-21T04:45:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f052154db332e48ea35b1a0d783361a40a361250'/>
<id>urn:sha1:f052154db332e48ea35b1a0d783361a40a361250</id>
<content type='text'>
We'll want to use this logic as a fallback when looking up
the pushremote, so let's pull it out into its own function.

We don't technically need to make this available outside of
remote.c, but doing so will provide a consistent API with
pushremote_for_branch, which we will add later.

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