<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/remote.c, 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>Merge branch 'bw/c-plus-plus'</title>
<updated>2018-03-06T22:54:07Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-03-06T22:54:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=169c9c0169a00876f699678ac66ebe9563b0c29f'/>
<id>urn:sha1:169c9c0169a00876f699678ac66ebe9563b0c29f</id>
<content type='text'>
Avoid using identifiers that clash with C++ keywords.  Even though
it is not a goal to compile Git with C++ compilers, changes like
this help use of code analysis tools that targets C++ on our
codebase.

* bw/c-plus-plus: (37 commits)
  replace: rename 'new' variables
  trailer: rename 'template' variables
  tempfile: rename 'template' variables
  wrapper: rename 'template' variables
  environment: rename 'namespace' variables
  diff: rename 'template' variables
  environment: rename 'template' variables
  init-db: rename 'template' variables
  unpack-trees: rename 'new' variables
  trailer: rename 'new' variables
  submodule: rename 'new' variables
  split-index: rename 'new' variables
  remote: rename 'new' variables
  ref-filter: rename 'new' variables
  read-cache: rename 'new' variables
  line-log: rename 'new' variables
  imap-send: rename 'new' variables
  http: rename 'new' variables
  entry: rename 'new' variables
  diffcore-delta: rename 'new' variables
  ...
</content>
</entry>
<entry>
<title>remote: rename 'new' variables</title>
<updated>2018-02-22T18:08:05Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2018-02-14T18:59:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f3bbe630389480666ff865a7563859de4722664d'/>
<id>urn:sha1:f3bbe630389480666ff865a7563859de4722664d</id>
<content type='text'>
Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</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>Merge branch 'js/for-each-ref-remote-name-and-ref'</title>
<updated>2017-11-15T03:14:32Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-11-15T03:14:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=093048b22913be23fe45635e8723d3aa3a185ff3'/>
<id>urn:sha1:093048b22913be23fe45635e8723d3aa3a185ff3</id>
<content type='text'>
The "--format=..." option "git for-each-ref" takes learned to show
the name of the 'remote' repository and the ref at the remote side
that is affected for 'upstream' and 'push' via "%(push:remotename)"
and friends.

* js/for-each-ref-remote-name-and-ref:
  for-each-ref: test :remotename and :remoteref
  for-each-ref: let upstream/push report the remote ref name
  for-each-ref: let upstream/push optionally report the remote name
</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>
</feed>
