<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/refspec.h, branch v2.45.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.45.4</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.45.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-08-04T21:12:23Z</updated>
<entry>
<title>docs: move protocol-related docs to man section 5</title>
<updated>2022-08-04T21:12:23Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-08-04T16:28:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5db921054e685a4dbaeb622acda53d6a154e947f'/>
<id>urn:sha1:5db921054e685a4dbaeb622acda53d6a154e947f</id>
<content type='text'>
Continue the move of existing Documentation/technical/* protocol and
file-format documentation into our main documentation space. By moving
the things that discuss the protocol we can properly link from
e.g. lsrefs.unborn and protocol.version documentation to a manpage we
build by default.

So far we have been using the "gitformat-" prefix for the
documentation we've been moving over from Documentation/technical/*,
but for protocol documentation let's use "gitprotocol-*".

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 '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>refspec: fix documentation referring to refspec_item</title>
<updated>2020-08-17T17:39:19Z</updated>
<author>
<name>Jacob Keller</name>
<email>jacob.keller@gmail.com</email>
</author>
<published>2020-08-15T00:25:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0becfec5b154c37a0cd2d3f7a6a0c908ba7b5c1e'/>
<id>urn:sha1:0becfec5b154c37a0cd2d3f7a6a0c908ba7b5c1e</id>
<content type='text'>
In commit d27eb356bf25 ("remote: move doc to remote.h and refspec.h")
the documentation for the refspec structure was moved into refspec.h

This documentation refers to elements of the refspec_item, not the
struct refspec. Move the documentation slightly in order to align it
with the structure it is actually referring to.

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>argv-array: rename to strvec</title>
<updated>2020-07-28T22:02:17Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-07-28T20:23:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=873cd28a8b17ff21908c78c7929a7615f8c94992'/>
<id>urn:sha1:873cd28a8b17ff21908c78c7929a7615f8c94992</id>
<content type='text'>
The name "argv-array" isn't very good, because it describes what the
data type can be used for (program argument arrays), not what it
actually is (a dynamically-growing string array that maintains a
NULL-terminator invariant). This leads to people being hesitant to use
it for other cases where it would actually be a good fit. The existing
name is also clunky to use. It's overly long, and the name often leads
to saying things like "argv.argv" (i.e., the field names overlap with
variable names, since they're describing the use, not the type). Let's
give it a more neutral name.

I settled on "strvec" because "vector" is the name for a dynamic array
type in many programming languages. "strarray" would work, too, but it's
longer and a bit more awkward to say (and don't we all say these things
in our mind as we type them?).

A more extreme direction would be a generic data structure which stores
a NULL-terminated of _any_ type. That would be easy to do with void
pointers, but we'd lose some type safety for the existing cases. Plus it
raises questions about memory allocation and ownership. So I limited
myself here to changing names only, and not semantics. If we do find a
use for that more generic data type, we could perhaps implement it at a
lower level and then provide type-safe wrappers around it for strings.
But that can come later.

This patch does the minimum to convert the struct and function names in
the header and implementation, leaving a few things for follow-on
patches:

  - files retain their original names for now

  - struct field names are retained for now

  - there's a preprocessor compat layer that lets most users remain the
    same for now. The exception is headers which made a manual forward
    declaration of the struct. I've converted them (and their dependent
    function declarations) here.

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: move doc to remote.h and refspec.h</title>
<updated>2019-11-18T06:21:28Z</updated>
<author>
<name>Heba Waly</name>
<email>heba.waly@gmail.com</email>
</author>
<published>2019-11-17T21:04:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d27eb356bf253be763ab08733fae723adda27e1c'/>
<id>urn:sha1:d27eb356bf253be763ab08733fae723adda27e1c</id>
<content type='text'>
Move the documentation from Documentation/technical/api-remote.txt to
remote.h and refspec.h as it's easier for the developers to find the usage
information beside the code instead of looking for it in another doc file.

N.B. The doc for both push and fetch members of the remote struct aren't
moved because they are out of date, as the members were changed from arrays
of rspecs to struct refspec 2 years ago.

Also documentation/technical/api-remote.txt is removed because the
information it has is now redundant and it'll be hard to keep it up to
date and synchronized with the documentation in the header file.

Signed-off-by: Heba Waly &lt;heba.waly@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refspec: add back a refspec_item_init() function</title>
<updated>2018-06-11T17:11:31Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2018-06-05T19:54:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c495fd3d1b4b6b395346a8832edbea25f0d60ee7'/>
<id>urn:sha1:c495fd3d1b4b6b395346a8832edbea25f0d60ee7</id>
<content type='text'>
Re-add the non-fatal version of refspec_item_init_or_die() renamed
away in an earlier change to get a more minimal diff. This should be
used by callers that have their own error handling.

This new function could be marked "static" since nothing outside of
refspec.c uses it, but expecting future use of it, let's make it
available to other users.

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>
</feed>
