<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/remote.c, branch v2.26.0-rc2</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v2.26.0-rc2</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v2.26.0-rc2'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2020-03-03T22:56:05Z</updated>
<entry>
<title>remote: drop "explicit" parameter from remote_ref_for_branch()</title>
<updated>2020-03-03T22:56:05Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-03-03T16:12:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=af8ccd8ade1e2dd1bf332067b98dd4459e29c1d3'/>
<id>urn:sha1:af8ccd8ade1e2dd1bf332067b98dd4459e29c1d3</id>
<content type='text'>
Commit 9700fae5ee (for-each-ref: let upstream/push report the remote
ref name, 2017-11-07) added a remote_ref_for_branch() helper, which
is modeled after remote_for_branch(). This includes providing an
"explicit" out-parameter that tells the caller whether the remote
was configured by the user, or whether we picked a default name like
"origin".

But unlike remote names, there is no default name when the user
didn't configure one.  The only way the "explicit" parameter is used
by the caller is to use the value returned from the helper when it
is set, and use an empty string otherwise, ignoring the returned
value from the helper.

Let's drop the "explicit" out-parameter, and return NULL when the
returned value from the helper should be ignored, to simplify the
function interface.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Damien Robert &lt;damien.olivier.robert+git@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>config: split repo scope to local and worktree</title>
<updated>2020-02-10T18:32:20Z</updated>
<author>
<name>Matthew Rogers</name>
<email>mattr94@gmail.com</email>
</author>
<published>2020-02-10T00:30:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=6dc905d97431d683b418978819629a2626555b2e'/>
<id>urn:sha1:6dc905d97431d683b418978819629a2626555b2e</id>
<content type='text'>
Previously when iterating through git config variables, worktree config
and local config were both considered "CONFIG_SCOPE_REPO".  This was
never a problem before as no one had needed to differentiate between the
two cases, but future functionality may care whether or not the config
options come from a worktree or from the repository's actual local
config file.  For example, the planned feature to add a '--show-scope'
to config to allow a user to see which scope listed config options come
from would confuse users if it just printed 'repo' rather than 'local'
or 'worktree' as the documentation would lead them to expect.  As well
as the additional benefit of making the implementation look more like
how the documentation describes the interface.

To accomplish this we split out what was previously considered repo
scope to be local and worktree.

The clients of 'current_config_scope()' who cared about
CONFIG_SCOPE_REPO are also modified to similarly care about
CONFIG_SCOPE_WORKTREE and CONFIG_SCOPE_LOCAL to preserve previous behavior.

Signed-off-by: Matthew Rogers &lt;mattr94@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>hashmap: remove type arg from hashmap_{get,put,remove}_entry</title>
<updated>2019-10-07T01:20:12Z</updated>
<author>
<name>Eric Wong</name>
<email>e@80x24.org</email>
</author>
<published>2019-10-06T23:30:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=404ab78e39fc74c4eb604b6003642ed264f687a6'/>
<id>urn:sha1:404ab78e39fc74c4eb604b6003642ed264f687a6</id>
<content type='text'>
Since these macros already take a `keyvar' pointer of a known type,
we can rely on OFFSETOF_VAR to get the correct offset without
relying on non-portable `__typeof__' and `offsetof'.

Argument order is also rearranged, so `keyvar' and `member' are
sequential as they are used as: `keyvar-&gt;member'

Signed-off-by: Eric Wong &lt;e@80x24.org&gt;
Reviewed-by: Derrick Stolee &lt;stolee@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>hashmap: hashmap_{put,remove} return hashmap_entry *</title>
<updated>2019-10-07T01:20:11Z</updated>
<author>
<name>Eric Wong</name>
<email>e@80x24.org</email>
</author>
<published>2019-10-06T23:30:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=8a973d0bb398d6d83d6c048acecc750d01bd7234'/>
<id>urn:sha1:8a973d0bb398d6d83d6c048acecc750d01bd7234</id>
<content type='text'>
And add *_entry variants to perform container_of as necessary
to simplify most callers.

Signed-off-by: Eric Wong &lt;e@80x24.org&gt;
Reviewed-by: Derrick Stolee &lt;stolee@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>hashmap_cmp_fn takes hashmap_entry params</title>
<updated>2019-10-07T01:20:11Z</updated>
<author>
<name>Eric Wong</name>
<email>e@80x24.org</email>
</author>
<published>2019-10-06T23:30:37Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=939af16eac1608766273d3971598dbcc4fe09928'/>
<id>urn:sha1:939af16eac1608766273d3971598dbcc4fe09928</id>
<content type='text'>
Another step in eliminating the requirement of hashmap_entry
being the first member of a struct.

Signed-off-by: Eric Wong &lt;e@80x24.org&gt;
Reviewed-by: Derrick Stolee &lt;stolee@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>hashmap_get{,_from_hash} return "struct hashmap_entry *"</title>
<updated>2019-10-07T01:20:11Z</updated>
<author>
<name>Eric Wong</name>
<email>e@80x24.org</email>
</author>
<published>2019-10-06T23:30:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=f23a465132a22860684ac66052cf9a954a18e27d'/>
<id>urn:sha1:f23a465132a22860684ac66052cf9a954a18e27d</id>
<content type='text'>
Update callers to use hashmap_get_entry, hashmap_get_entry_from_hash
or container_of as appropriate.

This is another step towards eliminating the requirement of
hashmap_entry being the first field in a struct.

Signed-off-by: Eric Wong &lt;e@80x24.org&gt;
Reviewed-by: Derrick Stolee &lt;stolee@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>hashmap_put takes "struct hashmap_entry *"</title>
<updated>2019-10-07T01:20:10Z</updated>
<author>
<name>Eric Wong</name>
<email>e@80x24.org</email>
</author>
<published>2019-10-06T23:30:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=26b455f21ed7e0c7b0e4e4e69b5ae48545597020'/>
<id>urn:sha1:26b455f21ed7e0c7b0e4e4e69b5ae48545597020</id>
<content type='text'>
This is less error-prone than "void *" as the compiler now
detects invalid types being passed.

Signed-off-by: Eric Wong &lt;e@80x24.org&gt;
Reviewed-by: Derrick Stolee &lt;stolee@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>hashmap_entry_init takes "struct hashmap_entry *"</title>
<updated>2019-10-07T01:20:09Z</updated>
<author>
<name>Eric Wong</name>
<email>e@80x24.org</email>
</author>
<published>2019-10-06T23:30:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=d22245a2e360d2e708ca37169be8eb5a5899b98d'/>
<id>urn:sha1:d22245a2e360d2e708ca37169be8eb5a5899b98d</id>
<content type='text'>
C compilers do type checking to make life easier for us.  So
rely on that and update all hashmap_entry_init callers to take
"struct hashmap_entry *" to avoid future bugs while improving
safety and readability.

Signed-off-by: Eric Wong &lt;e@80x24.org&gt;
Reviewed-by: Derrick Stolee &lt;stolee@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'dr/ref-filter-push-track-fix'</title>
<updated>2019-05-08T15:37:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-05-08T15:37:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=f560a4d1598106258f43d0d5cc04cae3e6aa93e2'/>
<id>urn:sha1:f560a4d1598106258f43d0d5cc04cae3e6aa93e2</id>
<content type='text'>
%(push:track) token used in the --format option to "git
for-each-ref" and friends was not showing the right branch, which
has been fixed.

* dr/ref-filter-push-track-fix:
  ref-filter: use correct branch for %(push:track)
</content>
</entry>
<entry>
<title>ref-filter: use correct branch for %(push:track)</title>
<updated>2019-04-18T00:17:41Z</updated>
<author>
<name>Damien Robert</name>
<email>damien.olivier.robert+git@gmail.com</email>
</author>
<published>2019-04-16T12:16:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=c646d0934ec2056d816ad1ecc23f6620aba2c6da'/>
<id>urn:sha1:c646d0934ec2056d816ad1ecc23f6620aba2c6da</id>
<content type='text'>
In ref-filter.c, when processing the atom %(push:track), the
ahead/behind values are computed using `stat_tracking_info` which refers
to the upstream branch.

Fix that by introducing a new flag `for_push` in `stat_tracking_info`
in remote.c, which does the same thing but for the push branch.
Update the few callers of `stat_tracking_info` to handle this flag. This
ensure that whenever we use this function in the future, we are careful
to specify is this should apply to the upstream or the push branch.

This bug was not detected in t/t6300-for-each-ref.sh because in the test
for push:track, both the upstream and the push branches were behind by 1
from the local branch. Change the test so that the upstream branch is
behind by 1 while the push branch is ahead by 1. This allows us to test
that %(push:track) refers to the correct branch.

This changes the expected value of some following tests (by introducing
new references), so update them too.

Signed-off-by: Damien Robert &lt;damien.olivier.robert+git@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>
</feed>
