<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/refspec.c, branch v2.40.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.40.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.40.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-02-24T23:59:53Z</updated>
<entry>
<title>refspec.c: use designated initializers for "struct refspec_item"</title>
<updated>2022-02-24T23:59:53Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-02-24T09:33:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b3454e2df2e2b2dcad045c62bedf9d0353a63723'/>
<id>urn:sha1:b3454e2df2e2b2dcad045c62bedf9d0353a63723</id>
<content type='text'>
Change the "struct refspec_item" at the top of refspec.c to use
designated initializers. Let's keep the "= 0" assignments for
self-documentation purposes, even though they're now redundant.

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>Merge branch 'fc/atmark-in-refspec'</title>
<updated>2020-12-14T18:21:36Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-12-14T18:21:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c59b73bef302f4efd0f853f913328aab534b1f1a'/>
<id>urn:sha1:c59b73bef302f4efd0f853f913328aab534b1f1a</id>
<content type='text'>
"@" sometimes worked (e.g. "git push origin @:there") as a part of
a refspec element, but "git push origin @" did not work, which has
been corrected.

* fc/atmark-in-refspec:
  refspec: make @ a synonym of HEAD
  tests: push: trivial cleanup
  tests: push: improve cleanup of HEAD tests
</content>
</entry>
<entry>
<title>refspec: trivial cleanup</title>
<updated>2020-12-01T18:31:29Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2020-12-01T00:46:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bfded8757032ea7095ed688a1065c9767016e509'/>
<id>urn:sha1:bfded8757032ea7095ed688a1065c9767016e509</id>
<content type='text'>
We can remove one level of indentation and make the code clearer.

No functional changes.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refspec: make @ a synonym of HEAD</title>
<updated>2020-11-30T21:57:55Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2020-11-26T00:16:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=374fbaef3df8f05acf9968fc38c6da72a62bcfc2'/>
<id>urn:sha1:374fbaef3df8f05acf9968fc38c6da72a62bcfc2</id>
<content type='text'>
Since commit 9ba89f484e git learned how to push to a remote branch using
the source @, for example:

  git push origin @:master

However, if the right-hand side is missing, the push fails:

  git push origin @

It is obvious what is the desired behavior, and allowing the push makes
things more consistent.

Additionally, @:master now has the same semantics as HEAD:master.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sb/clone-origin'</title>
<updated>2020-10-27T22:09:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-10-27T22:09:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=40696c67274305d6258539de5a36649cf833f712'/>
<id>urn:sha1:40696c67274305d6258539de5a36649cf833f712</id>
<content type='text'>
"git clone" learned clone.defaultremotename configuration variable
to customize what nickname to use to call the remote the repository
was cloned from.

* sb/clone-origin:
  clone: allow configurable default for `-o`/`--origin`
  clone: read new remote name from remote_name instead of option_origin
  clone: validate --origin option before use
  refs: consolidate remote name validation
  remote: add tests for add and rename with invalid names
  clone: use more conventional config/option layering
  clone: add tests for --template and some disallowed option pairs
</content>
</entry>
<entry>
<title>Merge branch 'jk/refspecs-negative'</title>
<updated>2020-10-05T21:01:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-10-05T21:01:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8e3ec76a20d6abf5dd8ceb3f5f2c157000e4c13e'/>
<id>urn:sha1:8e3ec76a20d6abf5dd8ceb3f5f2c157000e4c13e</id>
<content type='text'>
"git fetch" and "git push" support negative refspecs.

* jk/refspecs-negative:
  refspec: add support for negative refspecs
</content>
</entry>
<entry>
<title>refs: consolidate remote name validation</title>
<updated>2020-10-01T05:09:13Z</updated>
<author>
<name>Sean Barag</name>
<email>sean@barag.org</email>
</author>
<published>2020-10-01T03:46:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f2c6fda88624370fda1fc706a0f2ceda7d50d6ab'/>
<id>urn:sha1:f2c6fda88624370fda1fc706a0f2ceda7d50d6ab</id>
<content type='text'>
In preparation for a future patch, extract from remote.c a function that
validates possible remote names so that its rules can be used
consistently in other places.

Helped-by: Derrick Stolee &lt;stolee@gmail.com&gt;
Signed-off-by: Sean Barag &lt;sean@barag.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refspec: add support for negative refspecs</title>
<updated>2020-09-30T21:52:00Z</updated>
<author>
<name>Jacob Keller</name>
<email>jacob.keller@gmail.com</email>
</author>
<published>2020-09-30T21:25:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c0192df6306d4d9ad77f6015a053925b13155834'/>
<id>urn:sha1:c0192df6306d4d9ad77f6015a053925b13155834</id>
<content type='text'>
Both fetch and push support pattern refspecs which allow fetching or
pushing references that match a specific pattern. Because these patterns
are globs, they have somewhat limited ability to express more complex
situations.

For example, suppose you wish to fetch all branches from a remote except
for a specific one. To allow this, you must setup a set of refspecs
which match only the branches you want. Because refspecs are either
explicit name matches, or simple globs, many patterns cannot be
expressed.

Add support for a new type of refspec, referred to as "negative"
refspecs. These are prefixed with a '^' and mean "exclude any ref
matching this refspec". They can only have one "side" which always
refers to the source. During a fetch, this refers to the name of the ref
on the remote. During a push, this refers to the name of the ref on the
local side.

With negative refspecs, users can express more complex patterns. For
example:

 git fetch origin refs/heads/*:refs/remotes/origin/* ^refs/heads/dontwant

will fetch all branches on origin into remotes/origin, but will exclude
fetching the branch named dontwant.

Refspecs today are commutative, meaning that order doesn't expressly
matter. Rather than forcing an implied order, negative refspecs will
always be applied last. That is, in order to match, a ref must match at
least one positive refspec, and match none of the negative refspecs.
This is similar to how negative pathspecs work.

Signed-off-by: Jacob Keller &lt;jacob.keller@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refspec: add and use refspec_appendf()</title>
<updated>2020-09-06T20:15:46Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2020-09-05T14:49:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1af8b8c0a570ee0b12a19fdd920a3ea09fb22a75'/>
<id>urn:sha1:1af8b8c0a570ee0b12a19fdd920a3ea09fb22a75</id>
<content type='text'>
Add a function for building a refspec using printf-style formatting.  It
frees callers from managing their own buffer.  Use it throughout the
tree to shorten and simplify its callers.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>strvec: fix indentation in renamed calls</title>
<updated>2020-07-28T22:02:18Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-07-28T20:26:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f6d8942b1fc6c968980c8ae03054d7b2114b4415'/>
<id>urn:sha1:f6d8942b1fc6c968980c8ae03054d7b2114b4415</id>
<content type='text'>
Code which split an argv_array call across multiple lines, like:

  argv_array_pushl(&amp;args, "one argument",
                   "another argument", "and more",
		   NULL);

was recently mechanically renamed to use strvec, which results in
mis-matched indentation like:

  strvec_pushl(&amp;args, "one argument",
                   "another argument", "and more",
		   NULL);

Let's fix these up to align the arguments with the opening paren. I did
this manually by sifting through the results of:

  git jump grep 'strvec_.*,$'

and liberally applying my editor's auto-format. Most of the changes are
of the form shown above, though I also normalized a few that had
originally used a single-tab indentation (rather than our usual style of
aligning with the open paren). I also rewrapped a couple of obvious
cases (e.g., where previously too-long lines became short enough to fit
on one), but I wasn't aggressive about it. In cases broken to three or
more lines, the grouping of arguments is sometimes meaningful, and it
wasn't worth my time or reviewer time to ponder each case individually.

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