<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/remote.h, branch v2.17.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.17.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.17.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-03-08T20:36:24Z</updated>
<entry>
<title>Merge branch 'jh/status-no-ahead-behind'</title>
<updated>2018-03-08T20:36:24Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-03-08T20:36:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4094e47fd2c49fcdbd0152d20ed4d610d72680d7'/>
<id>urn:sha1:4094e47fd2c49fcdbd0152d20ed4d610d72680d7</id>
<content type='text'>
"git status" can spend a lot of cycles to compute the relation
between the current branch and its upstream, which can now be
disabled with "--no-ahead-behind" option.

* jh/status-no-ahead-behind:
  status: support --no-ahead-behind in long format
  status: update short status to respect --no-ahead-behind
  status: add --[no-]ahead-behind to status and commit for V2 format.
  stat_tracking_info: return +1 when branches not equal
</content>
</entry>
<entry>
<title>fetch: add a --prune-tags option and fetch.pruneTags config</title>
<updated>2018-02-09T21:10:13Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2018-02-09T20:32:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=97716d217c1ea00adfc64e4f6bb85c1236d661ff'/>
<id>urn:sha1:97716d217c1ea00adfc64e4f6bb85c1236d661ff</id>
<content type='text'>
Add a --prune-tags option to git-fetch, along with fetch.pruneTags
config option and a -P shorthand (-p is --prune). This allows for
doing any of:

    git fetch -p -P
    git fetch --prune --prune-tags
    git fetch -p -P origin
    git fetch --prune --prune-tags origin

Or simply:

    git config fetch.prune true &amp;&amp;
    git config fetch.pruneTags true &amp;&amp;
    git fetch

Instead of the much more verbose:

    git fetch --prune origin 'refs/tags/*:refs/tags/*' '+refs/heads/*:refs/remotes/origin/*'

Before this feature it was painful to support the use-case of pulling
from a repo which is having both its branches *and* tags deleted
regularly, and have our local references to reflect upstream.

At work we create deployment tags in the repo for each rollout, and
there's *lots* of those, so they're archived within weeks for
performance reasons.

Without this change it's hard to centrally configure such repos in
/etc/gitconfig (on servers that are only used for working with
them). You need to set fetch.prune=true globally, and then for each
repo:

    git -C {} config --replace-all remote.origin.fetch "refs/tags/*:refs/tags/*" "^\+*refs/tags/\*:refs/tags/\*$"

Now I can simply set fetch.pruneTags=true in /etc/gitconfig as well,
and users running "git pull" will automatically get the pruning
semantics I want.

Even though "git remote" has corresponding "prune" and "update
--prune" subcommands I'm intentionally not adding a corresponding
prune-tags or "update --prune --prune-tags" mode to that command.

It's advertised (as noted in my recent "git remote doc: correct
dangerous lies about what prune does") as only modifying remote
tracking references, whereas any --prune-tags option is always going
to modify what from the user's perspective is a local copy of the tag,
since there's no such thing as a remote tracking tag.

Ideally add_prune_tags_to_fetch_refspec() would be something that
would use ALLOC_GROW() to grow the 'fetch` member of the 'remote'
struct. Instead I'm realloc-ing remote-&gt;fetch and adding the
tag_refspec to the end.

The reason is that parse_{fetch,push}_refspec which allocate the
refspec (ultimately remote-&gt;fetch) struct are called many places that
don't have access to a 'remote' struct. It would be hard to change all
their callsites to be amenable to carry around the bookkeeping
variables required for dynamic allocation.

All the other callers of the API first incrementally construct the
string version of the refspec in remote-&gt;fetch_refspec via
add_fetch_refspec(), before finally calling parse_fetch_refspec() via
some variation of remote_get().

It's less of a pain to deal with the one special case that needs to
modify already constructed refspecs than to chase down and change all
the other callsites. The API I'm adding is intentionally not
generalized because if we add more of these we'd probably want to
re-visit how this is done.

See my "Re: [BUG] git remote prune removes local tags, depending on
fetch config" (87po6ahx87.fsf@evledraar.gmail.com;
https://public-inbox.org/git/87po6ahx87.fsf@evledraar.gmail.com/) for
more background info.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>remote: add a macro for "refs/tags/*:refs/tags/*"</title>
<updated>2018-02-09T21:10:12Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2018-02-09T20:32:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=750d0da9cfbc2519f1ef478d50de0ce549c41f05'/>
<id>urn:sha1:750d0da9cfbc2519f1ef478d50de0ce549c41f05</id>
<content type='text'>
Add a macro with the refspec string "refs/tags/*:refs/tags/*". There's
been a pre-defined struct version of this since e0aaa29ff3 ("Have a
constant extern refspec for "--tags"", 2008-04-17), but nothing that
could be passed to e.g. add_fetch_refspec().

This will be used in subsequent commits to avoid hardcoding this
string in multiple places.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>status: support --no-ahead-behind in long format</title>
<updated>2018-01-24T21:48:39Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhost@microsoft.com</email>
</author>
<published>2018-01-09T18:50:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f39a757dd93488103dde76e992a75edf2d772b62'/>
<id>urn:sha1:f39a757dd93488103dde76e992a75edf2d772b62</id>
<content type='text'>
Teach long (normal) status format to respect the --no-ahead-behind
parameter and skip the possibly expensive ahead/behind computation
between the branch and the upstream.

Signed-off-by: Jeff Hostetler &lt;jeffhost@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>status: add --[no-]ahead-behind to status and commit for V2 format.</title>
<updated>2018-01-24T21:48:38Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhost@microsoft.com</email>
</author>
<published>2018-01-09T18:50:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fd9b544a2991ad74d73ad1bc0af4d24f91a6802b'/>
<id>urn:sha1:fd9b544a2991ad74d73ad1bc0af4d24f91a6802b</id>
<content type='text'>
Teach "git status" and "git commit" to accept "--no-ahead-behind"
and "--ahead-behind" arguments to request quick or full ahead/behind
reporting.

When "--no-ahead-behind" is given, the existing porcelain V2 line
"branch.ab +x -y" is replaced with a new "branch.ab +? -?" line.
This indicates that the branch and its upstream are or are not equal
without the expense of computing the full ahead/behind values.

Signed-off-by: Jeff Hostetler &lt;jeffhost@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>stat_tracking_info: return +1 when branches not equal</title>
<updated>2018-01-24T21:48:38Z</updated>
<author>
<name>Jeff Hostetler</name>
<email>jeffhost@microsoft.com</email>
</author>
<published>2018-01-09T18:50:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d7d1b496aeea5a151c826683ed28c57ef0ac9389'/>
<id>urn:sha1:d7d1b496aeea5a151c826683ed28c57ef0ac9389</id>
<content type='text'>
Extend stat_tracking_info() to return +1 when branches are not equal and to
take a new "enum ahead_behind_flags" argument to allow skipping the (possibly
expensive) ahead/behind computation.

This will be used in the next commit to allow "git status" to avoid full
ahead/behind calculations for performance reasons.

Signed-off-by: Jeff Hostetler &lt;jeffhost@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>for-each-ref: let upstream/push report the remote ref name</title>
<updated>2017-11-08T01:18:23Z</updated>
<author>
<name>J Wyman</name>
<email>jwyman@microsoft.com</email>
</author>
<published>2017-11-07T16:31:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9700fae5ee93dd0928cb82afb7b2fd49295e28d2'/>
<id>urn:sha1:9700fae5ee93dd0928cb82afb7b2fd49295e28d2</id>
<content type='text'>
There are times when scripts want to know not only the name of the
push branch on the remote, but also the name of the branch as known
by the remote repository.

An example of this is when a tool wants to push to the very same branch
from which it would pull automatically, i.e. the `&lt;remote&gt;` and the `&lt;to&gt;`
in `git push &lt;remote&gt; &lt;from&gt;:&lt;to&gt;` would be provided by
`%(upstream:remotename)` and `%(upstream:remoteref)`, respectively.

This patch offers the new suffix :remoteref for the `upstream` and `push`
atoms, allowing to show exactly that. Example:

	$ cat .git/config
	...
	[remote "origin"]
		url = https://where.do.we.come/from
		fetch = refs/heads/*:refs/remote/origin/*
	[branch "master"]
		remote = origin
		merge = refs/heads/master
	[branch "develop/with/topics"]
		remote = origin
		merge = refs/heads/develop/with/topics
	...

	$ git for-each-ref \
		--format='%(push) %(push:remoteref)' \
		refs/heads
	refs/remotes/origin/master refs/heads/master
	refs/remotes/origin/develop/with/topics refs/heads/develop/with/topics

Signed-off-by: J Wyman &lt;jwyman@microsoft.com&gt;
Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>remote: convert struct push_cas to struct object_id</title>
<updated>2017-07-17T20:54:38Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2017-07-13T23:49:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b8566f8ff9773c1a3a7f47e9b205cd08b2ad6747'/>
<id>urn:sha1:b8566f8ff9773c1a3a7f47e9b205cd08b2ad6747</id>
<content type='text'>
This gets rid of one use of get_sha1.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'bw/push-options-recursively-to-submodules'</title>
<updated>2017-04-20T04:37:14Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-04-20T04:37:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=872e2cf00a570e9d83e40343579a7bb092307d53'/>
<id>urn:sha1:872e2cf00a570e9d83e40343579a7bb092307d53</id>
<content type='text'>
"git push --recurse-submodules --push-option=&lt;string&gt;" learned to
propagate the push option recursively down to pushes in submodules.

* bw/push-options-recursively-to-submodules:
  push: propagate remote and refspec with --recurse-submodules
  submodule--helper: add push-check subcommand
  remote: expose parse_push_refspec function
  push: propagate push-options with --recurse-submodules
  push: unmark a local variable as static
</content>
</entry>
<entry>
<title>Merge branch 'bc/object-id'</title>
<updated>2017-04-20T04:37:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-04-20T04:37:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b1081e4004091947b6c6a806625addd1cbba61b7'/>
<id>urn:sha1:b1081e4004091947b6c6a806625addd1cbba61b7</id>
<content type='text'>
Conversion from unsigned char [40] to struct object_id continues.

* bc/object-id:
  Documentation: update and rename api-sha1-array.txt
  Rename sha1_array to oid_array
  Convert sha1_array_for_each_unique and for_each_abbrev to object_id
  Convert sha1_array_lookup to take struct object_id
  Convert remaining callers of sha1_array_lookup to object_id
  Make sha1_array_append take a struct object_id *
  sha1-array: convert internal storage for struct sha1_array to object_id
  builtin/pull: convert to struct object_id
  submodule: convert check_for_new_submodule_commits to object_id
  sha1_name: convert disambiguate_hint_fn to take object_id
  sha1_name: convert struct disambiguate_state to object_id
  test-sha1-array: convert most code to struct object_id
  parse-options-cb: convert sha1_array_append caller to struct object_id
  fsck: convert init_skiplist to struct object_id
  builtin/receive-pack: convert portions to struct object_id
  builtin/pull: convert portions to struct object_id
  builtin/diff: convert to struct object_id
  Convert GIT_SHA1_RAWSZ used for allocation to GIT_MAX_RAWSZ
  Convert GIT_SHA1_HEXSZ used for allocation to GIT_MAX_HEXSZ
  Define new hash-size constants for allocating memory
</content>
</entry>
</feed>
