<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/trailer.c, branch v2.12.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.12.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.12.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-11-29T22:22:18Z</updated>
<entry>
<title>trailer: have function to describe trailer layout</title>
<updated>2016-11-29T22:22:18Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2016-11-02T17:29:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e8c352c316f31a3869f3ad1dae0e8b33042cbaf4'/>
<id>urn:sha1:e8c352c316f31a3869f3ad1dae0e8b33042cbaf4</id>
<content type='text'>
Create a function that, taking a string, describes the position of its
trailer block (if available) and the contents thereof, and make trailer
use it. This makes it easier for other Git components, in the future, to
interpret trailer blocks in the same way as trailer.

In a subsequent patch, another component will be made to use this.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trailer: avoid unnecessary splitting on lines</title>
<updated>2016-11-29T22:22:18Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2016-11-02T17:29:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=022349c3b091f2aa047f1cd12b5409d564b25324'/>
<id>urn:sha1:022349c3b091f2aa047f1cd12b5409d564b25324</id>
<content type='text'>
trailer.c currently splits lines while processing a buffer (and also
rejoins lines when needing to invoke ignore_non_trailer).

Avoid such line splitting, except when generating the strings
corresponding to trailers (for ease of use by clients - a subsequent
patch will allow other components to obtain the layout of a trailer
block in a buffer, including the trailers themselves). The main purpose
of this is to make it easy to return pointers into the original buffer
(for a subsequent patch), but this also significantly reduces the number
of memory allocations required.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit: make ignore_non_trailer take buf/len</title>
<updated>2016-11-29T22:22:18Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2016-11-02T17:29:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=710714aaa822acbad14f1b7100fa2776d2bc8ce6'/>
<id>urn:sha1:710714aaa822acbad14f1b7100fa2776d2bc8ce6</id>
<content type='text'>
Make ignore_non_trailer take a buf/len pair instead of struct strbuf.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trailer: be stricter in parsing separators</title>
<updated>2016-11-29T22:22:08Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2016-11-02T17:29:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e4319562bc2834096fade432fd90c985b96476db'/>
<id>urn:sha1:e4319562bc2834096fade432fd90c985b96476db</id>
<content type='text'>
Currently, a line is interpreted to be a trailer line if it contains a
separator. Make parsing stricter by requiring the text on the left of
the separator, if not the empty string, to be of the "&lt;token&gt;&lt;optional
whitespace&gt;" form.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jt/trailer-with-cruft'</title>
<updated>2016-10-31T20:15:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-10-31T20:15:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cabb79d8c1c5e4f81f3435603f17c74480888395'/>
<id>urn:sha1:cabb79d8c1c5e4f81f3435603f17c74480888395</id>
<content type='text'>
Update "interpret-trailers" machinery and teaches it that people in
real world write all sorts of crufts in the "trailer" that was
originally designed to have the neat-o "Mail-Header: like thing"
and nothing else.

* jt/trailer-with-cruft:
  trailer: support values folded to multiple lines
  trailer: forbid leading whitespace in trailers
  trailer: allow non-trailers in trailer block
  trailer: clarify failure modes in parse_trailer
  trailer: make args have their own struct
  trailer: streamline trailer item create and add
  trailer: use list.h for doubly-linked list
  trailer: improve const correctness
</content>
</entry>
<entry>
<title>trailer: support values folded to multiple lines</title>
<updated>2016-10-21T18:48:35Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2016-10-21T17:55:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=60ef86a16268bfb1efb28bcb3f1b646bfad1931c'/>
<id>urn:sha1:60ef86a16268bfb1efb28bcb3f1b646bfad1931c</id>
<content type='text'>
Currently, interpret-trailers requires that a trailer be only on 1 line.
For example:

a: first line
   second line

would be interpreted as one trailer line followed by one non-trailer line.

Make interpret-trailers support RFC 822-style folding, treating those
lines as one logical trailer.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trailer: forbid leading whitespace in trailers</title>
<updated>2016-10-21T18:48:35Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2016-10-21T17:55:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c463a6b28023dd3ad7ad4542147e20c27dbc83d6'/>
<id>urn:sha1:c463a6b28023dd3ad7ad4542147e20c27dbc83d6</id>
<content type='text'>
Currently, interpret-trailers allows leading whitespace in trailer
lines. This leads to false positives, especially for quoted lines or
bullet lists.

Forbid leading whitespace in trailers.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trailer: allow non-trailers in trailer block</title>
<updated>2016-10-21T18:48:35Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2016-10-21T17:55:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=146245063e286d5a38b146bd5a38da958bd3957b'/>
<id>urn:sha1:146245063e286d5a38b146bd5a38da958bd3957b</id>
<content type='text'>
Currently, interpret-trailers requires all lines of a trailer block to
be trailers (or comments) - if not it would not identify that block as a
trailer block, and thus create its own trailer block, inserting a blank
line.  For example:

  echo -e "\nSigned-off-by: x\nnot trailer" |
  git interpret-trailers --trailer "c: d"

would result in:

  Signed-off-by: x
  not trailer

  c: d

Relax the definition of a trailer block to require that the trailers (i)
are all trailers, or (ii) contain at least one Git-generated trailer and
consists of at least 25% trailers.

  Signed-off-by: x
  not trailer
  c: d

(i) is the existing functionality. (ii) allows arbitrary lines to be
included in trailer blocks, like those in [1], and still allow
interpret-trailers to be used.

[1]
https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable/+/e7d316a02f683864a12389f8808570e37fb90aa3

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trailer: clarify failure modes in parse_trailer</title>
<updated>2016-10-21T18:48:35Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2016-10-21T17:55:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fdbf4510aeb7e7b860c2ee77b8a4a3c5787fe182'/>
<id>urn:sha1:fdbf4510aeb7e7b860c2ee77b8a4a3c5787fe182</id>
<content type='text'>
The parse_trailer function has a few modes of operation, all depending
on whether the separator is present in its input, and if yes, the
separator's position. Some of these modes are failure modes, and these
failure modes are handled differently depending on whether the trailer
line was sourced from a file or from a command-line argument.

Extract a function to find the separator, allowing the invokers of
parse_trailer to determine how to handle the failure modes instead of
making parse_trailer do it. In this function, also take in the list of
separators, so that we can distinguish between command line arguments
(which allow '=' as separator) and file input (which does not allow '='
as separator).

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>trailer: make args have their own struct</title>
<updated>2016-10-20T22:09:52Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2016-10-20T21:39:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cc71b0de115808835486bc10d094b49261128276'/>
<id>urn:sha1:cc71b0de115808835486bc10d094b49261128276</id>
<content type='text'>
Improve type safety by making arguments (whether from configuration or
from the command line) have their own "struct arg_item" type, separate
from the "struct trailer_item" type used to represent the trailers in
the buffer being manipulated.

This change also prepares "struct trailer_item" to be further
differentiated from "struct arg_item" in future patches.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
