On 02/15/2017 03:11 PM, Junio C Hamano wrote:
Junio C Hamano writes:
Perhaps something like this?
This looks good. I was hoping to unify the processing logic between this
CLI parsing and the usual stream parsing, but this approach is probably
simpler.
config.c | 16
On 02/15/2017 10:53 AM, Junio C Hamano wrote:
Lars Schneider writes:
It looks like as if submodule configs ("submodule.*") for submodules
with upper case names are ignored.
This observation is surprising, as the second level in three-level
names like ".." is
On 02/14/2017 10:04 AM, Jeff King wrote:
On Tue, Feb 14, 2017 at 08:53:04AM -0800, Jonathan Tan wrote:
On 02/13/2017 10:07 PM, Jeff King wrote:
diff --git a/builtin/grep.c b/builtin/grep.c
index e83b33bda..c4c632594 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -1176,6 +1176,12 @@ int
On 02/13/2017 10:00 PM, Jeff King wrote:
I've fixed that, along with a few other bugs and cleanups. The complete
series is below. Patch 2 is your (untouched) patch. My suggestions for
your test are in patch 3, which can either remain on its own or be
squashed in.
[1/7]: grep: move thread
On 02/13/2017 10:07 PM, Jeff King wrote:
diff --git a/builtin/grep.c b/builtin/grep.c
index e83b33bda..c4c632594 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -1176,6 +1176,12 @@ int cmd_grep(int argc, const char **argv, const char
*prefix)
break;
}
ore, always interpret "--" as signaling the end of options,
instead of trying to interpret it as a rev first.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
There is probably a similar bug for commands of the form:
git grep --no-index pattern foo
If there
Looking back at the comments I have received in reply, I think that
there were two major concerns: (i) the case where a server ACKs a client
"have" line and the client forever thinks that the server has it, but it
may not be the case for future servers (or future invocations of the
same server),
On 01/27/2017 02:31 PM, tsuna wrote:
Hi there,
While investigating a hung job in our CI system today, I think I found
a deadlock in git-remote-http
Git version: 2.9.3
Linux (amd64) kernel 4.9.0
Excerpt from the process list:
jenkins 27316 0.0 0.0 18508 6024 ?S19:30 0:00 |
On 01/26/2017 02:33 PM, Junio C Hamano wrote:
Jonathan Tan <jonathanta...@google.com> writes:
diff --git a/t/lib-httpd/one-time-sed.sh b/t/lib-httpd/one-time-sed.sh
new file mode 100644
index 0..060ec0300
--- /dev/null
+++ b/t/lib-httpd/one-time-sed.sh
@@ -0,0 +1,8 @@
+#!/
On 01/26/2017 02:23 PM, Junio C Hamano wrote:
Jonathan Tan <jonathanta...@google.com> writes:
Currently, while performing packfile negotiation [1], upload-pack allows
clients to specify their desired objects only as SHA-1s. This causes:
(a) vulnerability to failure when an object tur
Thanks for your comments.
On 01/26/2017 03:00 PM, Jeff King wrote:
On Wed, Jan 25, 2017 at 02:02:53PM -0800, Jonathan Tan wrote:
Negotiation currently happens by upload-pack initially sending a list of
refs with names and SHA-1 hashes, and then several request/response
pairs in which
On 01/25/2017 04:50 PM, Stefan Beller wrote:
On Wed, Jan 25, 2017 at 2:03 PM, Jonathan Tan <jonathanta...@google.com> wrote:
In fetch-pack, during a stateless RPC, printf is invoked after stdout is
closed. Update the code to not do this, preserving the existing
behavior.
This seems
Refactor find_non_local_tags and get_ref_map to only take the
information they need instead of the entire transport struct. Besides
improving code clarity, this also improves their flexibility, which will
be needed in a future patch.
Signed-off-by: Jonathan Tan <jonathanta...@google.
Teach fetch-pack to support partial ref names and ref patterns as input.
This does not use "want-ref" yet - support for that will be added in a
future patch.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
builtin/fetch-pack.c | 40 ---
the nested
for loop in this patch.)
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
builtin/fetch-pack.c | 7 ++-
fetch-pack.c | 9 ++---
fetch-pack.h | 2 --
remote.h | 3 +--
4 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/buil
by the fetch mechanism.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
builtin/clone.c | 14 --
builtin/fetch-pack.c | 4 ++--
fetch-pack.c | 26 +++---
fetch-pack.h | 2 +-
transport-helper.c
---
t/t5500-fetch-pack.sh | 2 ++
upload-pack.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index 18fe23c97..f39dbcab8 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -551,6 +551,7 @@
a remote-tracking
branch seems to track more than one remote branch.
This is the 1st of 3 patches to eliminate using input refs to
communicate information obtained by the fetch mechanism.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
builtin/clone.c| 4 ++--
b
Teach fetch-pack to use the want-ref mechanism whenever the server
advertises it.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
builtin/fetch-pack.c | 5 +-
fetch-pack.c | 173 --
fetch-pack.h | 2 +
t
his effort, a mechanism to substitute strings in an HTTP
response only on the first invocation is added.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
t/lib-httpd.sh | 1 +
t/lib-httpd/apache.conf| 8
t/lib-httpd/one-time-sed.sh|
Refactor the fetch_refs function into a function that does the fetching
of refs and another function that stores them. This prepares for a
future patch where some processing may be done between those tasks.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
builtin/fetch.
In fetch-pack, during a stateless RPC, printf is invoked after stdout is
closed. Update the code to not do this, preserving the existing
behavior.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
builtin/fetch-pack.c | 14 ++
1 file changed, 10 insertions(+), 4 del
Teach fetch to send refspecs to the underlying transport, and teach all
components used by the HTTP transport (remote-curl, transport-helper,
fetch-pack) to understand and propagate the names and SHA-1s of the refs
fetched.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
b
"want-ref refs/heads/foo", "want-ref
refs/tags/foo", among others, and ensure that at least one such ref has
been fetched.
[2] <20161024132932.i42rqn2vlpocq...@sigill.intra.peff.net>
Jonathan Tan (14):
upload-pack: move parsing of "want" line
Populate SHA-1 ref hashes in get_ref_map instead of do_fetch. Besides
tightening scopes of variables in the code, this also prepares for a
future patch where get_ref_map is called multiple times within do_fetch.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
builtin/fetch.
quot;, among others, and ensure that at least one such ref has
been fetched.
[1] pack-protocol.txt
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
Documentation/technical/http-protocol.txt | 20 +-
Documentation/technical/pack-protocol.txt | 24 +-
Documen
Refactor to parse "want" lines when the prefix is found. This makes it
easier to add support for another prefix, which will be done in a
subsequent commit.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
upload-pack.c | 28 ++--
1 file change
On 01/12/2017 01:20 AM, Matthew Wilcox wrote:
From: Matthew Wilcox
Extend the --scissors mechanism to strip off the preamble created by
forwarding a patch. There are a couple of extra headers ("Sent" and
"To") added by forwarding, but other than that, the --scissors
On 01/12/2017 01:20 AM, Matthew Wilcox wrote:
From: Matthew Wilcox
If you have a base-64 encoded patch with CRLF endings (as produced
by forwarding a patch from Outlook to a Linux machine, for example),
the keep_cr setting is not honoured because keep_cr is only passed
On 12/19/2016 12:38 PM, Kyle J. McKay wrote:
On Dec 19, 2016, at 12:03, Jeff King wrote:
On Sat, Dec 17, 2016 at 11:54:18AM -0800, Kyle J. McKay wrote:
Since 6b4b013f18 (mailinfo: handle in-body header continuations,
2016-09-20, v2.11.0) mailinfo.c has contained new code with an
assert of
emote ref always
has the contents of the local ref of the same name.
(Git also cannot assume that the remote ref has the value of the current
destination local ref, or any other ref, since the previous import/fetch
could have been made using a different refspec.)
Drop that assumption.
Signed-off-by: Jona
s2 M1 local refs/remotes/origin/master &&
+ compare_refs s2 B1 local refs/remotes/origin/mybranch &&
+
+ # One unchanged branch
+
+ GIT_REMOTE_TESTGIT_UNCHANGED_BRANCH_REGEX=mybranch git -C local fetch &&
+ compare_refs s2 M1 local refs/remotes/origin/master &&am
On Mon, Nov 28, 2016 at 4:06 PM, Junio C Hamano <gits...@pobox.com> wrote:
> Jonathan Tan <jonathanta...@google.com> writes:
>
>> On 11/23/2016 03:21 PM, Junio C Hamano wrote:
>>> * jt/use-trailer-api-in-commands (2016-11-02) 6 commits
>>> - sequencer: u
On 11/23/2016 03:21 PM, Junio C Hamano wrote:
* jt/use-trailer-api-in-commands (2016-11-02) 6 commits
- sequencer: use trailer's trailer layout
- trailer: have function to describe trailer layout
- trailer: avoid unnecessary splitting on lines
- commit: make ignore_non_trailer take buf/len
/t7513-interpret-trailers.sh
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
Yes, mentioning a trailer in a Git config will cause interpret-trailers
to treat it similarly to a Git-generated trailer (in that its presence
causes a block partially consisting of trailers to be considered
On 11/14/2016 10:56 AM, Junio C Hamano wrote:
Jonathan Tan <jonathanta...@google.com> writes:
to:
HEAD:file
HEAD:sub/file
Signed-off-by: Brandon Williams <bmw...@google.com>
---
Unrelated tangent, but this makes readers wonder what the updated
trailer code would do to the la
On 11/14/2016 10:10 AM, Junio C Hamano wrote:
Brandon Williams writes:
Teach grep to recursively search in submodules when provided with a
object. This allows grep to search a submodule based on the state
of the submodule that is present in a commit of the super project.
On 10/31/2016 03:38 PM, Brandon Williams wrote:
diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt
index 17aa1ba..386a868 100644
--- a/Documentation/git-grep.txt
+++ b/Documentation/git-grep.txt
@@ -26,7 +26,7 @@ SYNOPSIS
[--threads ]
[-f ] [-e]
ot; anyway.
This was introduced in commit c5a84e9 ("fetch --tags: fetch tags *in
addition to* other stuff", 2013-10-29) when modifying the effect of the
--tags parameter to "git fetch". The refmap-for-tag calculation was
copied instead of moved.
Signed-off-by: Jonathan Tan <
On Thu, Oct 27, 2016 at 3:38 PM, Brandon Williams wrote:
> diff --git a/builtin/grep.c b/builtin/grep.c
> index 8887b6add..f34f16df9 100644
> --- a/builtin/grep.c
> +++ b/builtin/grep.c
> @@ -18,12 +18,20 @@
> #include "quote.h"
> #include "dir.h"
> #include "pathspec.h"
>
On 10/31/2016 03:38 PM, Brandon Williams wrote:
+ struct strbuf buf = STRBUF_INIT;
+ char *submodule_url = NULL;
+
+ strbuf_addf(, "submodule.%s.url", module->name);
+ ret = !git_config_get_string(buf.buf, _url);
+
+
Make ignore_non_trailer take a buf/len pair instead of struct strbuf.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
builtin/commit.c | 2 +-
commit.c | 22 +++---
commit.h | 2 +-
trailer.c| 2 +-
4 files changed, 14 insertions(
-by: Jonathan Tan <jonathanta...@google.com>
---
trailer.c | 194 --
1 file changed, 100 insertions(+), 94 deletions(-)
diff --git a/trailer.c b/trailer.c
index 9d7765e..afbff4b 100644
--- a/trailer.c
+++ b/trailer.c
@@ -102,12 +102,12 @@ stat
locks under
certain conditions, and therefore suppressing the extra newline in those
cases.
Consistency with trailer extends to respecting trailer configs. Tests
have been included to show that.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
, another component will be made to use this.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
trailer.c | 118 +++---
trailer.h | 25 +
2 files changed, 107 insertions(+), 36 deletions(-)
diff --git a/trailer.c b/tra
This is the same as v2 except that in 1/5, the comment about
find_separators has been moved from the commit message to the code
itself. Also, a trailing whitespace and unused variable fix.
Jonathan Tan (5):
trailer: be stricter in parsing separators
commit: make ignore_non_trailer take buf
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 "" form.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
On 11/01/2016 01:37 PM, Junio C Hamano wrote:
Junio C Hamano <gits...@pobox.com> writes:
Jonathan Tan <jonathanta...@google.com> writes:
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
t
temporary strings that
include '\n' to be passed into the find_separator method.
In 2/4 (now 3/5), I've also changed some variable names as requested
(e.g. sb -> input, and un-did some others).
Jonathan Tan (5):
trailer: be stricter in parsing separators
commit: make ignore_non_trailer t
tor-starts-line case because some callers of this function
need such a distinction.)
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
trailer.c | 23 +--
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/trailer.c b/trailer.c
index f0ecde2
-by: Jonathan Tan <jonathanta...@google.com>
---
trailer.c | 195 --
1 file changed, 101 insertions(+), 94 deletions(-)
diff --git a/trailer.c b/trailer.c
index 04edab2..f5427ec 100644
--- a/trailer.c
+++ b/trailer.c
@@ -102,12 +102,12 @@ stat
, another component will be made to use this.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
trailer.c | 118 +++---
trailer.h | 25 +
2 files changed, 107 insertions(+), 36 deletions(-)
diff --git a/trailer.c b/tra
Make ignore_non_trailer take a buf/len pair instead of struct strbuf.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
builtin/commit.c | 2 +-
commit.c | 22 +++---
commit.h | 2 +-
trailer.c| 2 +-
4 files changed, 14 insertions(
locks under
certain conditions, and therefore suppressing the extra newline in those
cases.
Consistency with trailer extends to respecting trailer configs. Tests
have been included to show that.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
On 10/31/2016 06:11 PM, Junio C Hamano wrote:
Jonathan Tan <jonathanta...@google.com> writes:
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index ba4902d..635b394 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -1277,8 +1277,7 @@ EOF
4:Subject:
, another component will be made to use this.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
trailer.c | 120 +++---
trailer.h | 25 +
2 files changed, 108 insertions(+), 37 deletions(-)
diff --git a/trailer.c b/tra
locks under
certain conditions, and therefore suppressing the extra newline in those
cases.
Consistency with trailer extends to respecting trailer configs. Tests
have been included to show that.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
Make ignore_non_trailer take a buf/len pair instead of struct strbuf.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
builtin/commit.c | 2 +-
commit.c | 22 +++---
commit.h | 2 +-
trailer.c| 2 +-
4 files changed, 14 insertions(
-by: Jonathan Tan <jonathanta...@google.com>
---
trailer.c | 215 +-
1 file changed, 116 insertions(+), 99 deletions(-)
diff --git a/trailer.c b/trailer.c
index 6d8375b..d4d9e10 100644
--- a/trailer.c
+++ b/trailer.c
@@ -102,12 +102,12 @@ stat
t, the aforementioned commands would now handle trailers like
those described in [1].
[1] <84f28caa-2e4b-1231-1a76-3b7e765c0...@google.com>
Jonathan Tan (4):
commit: make ignore_non_trailer take buf/len
trailer: avoid unnecessary splitting on lines
trailer: have function to describe trail
On 10/26/2016 03:29 PM, Junio C Hamano wrote:
* jt/trailer-with-cruft (2016-10-21) 8 commits
- 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
-
Currently, creation and addition (to a list) of trailer items are spread
across multiple functions. Streamline this by only having 2 functions:
one to parse the user-supplied string, and one to add the parsed
information to a list.
Signed-off-by: Jonathan Tan <jonathanta...@google.
.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
Documentation/git-interpret-trailers.txt | 7 +-
t/t7513-interpret-trailers.sh| 169 +++
trailer.c| 45 ++--
3 files changed, 211 insertions(+), 10 del
Replace the existing handwritten implementation of a doubly-linked list
in trailer.c with the functions and macros from list.h. This
significantly simplifies the code.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
Signed-off-by: Ramsay Jones <ram...@ramsayjones.plus.com>
--
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 <jonathanta...@google.com>
---
Documentation/git-interpret-trailers.tx
89f8808570e37fb90aa3
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
Documentation/git-interpret-trailers.txt | 5 +-
t/t7513-interpret-trailers.sh| 115 +++
trailer.c| 89
3 fil
it as its own function.
No other updates.
Jonathan Tan (8):
trailer: improve const correctness
trailer: use list.h for doubly-linked list
trailer: streamline trailer item create and add
trailer: make args have their own struct
trailer: clarify failure modes in parse_trailer
trailer: allow
Change "const char *" to "char *" in struct trailer_item and in the
return value of apply_command (since those strings are owned strings).
Change "struct conf_info *" to "const struct conf_info *" (since that
struct is not modified).
Signed-off-by
command line arguments
(which allow '=' as separator) and file input (which does not allow '='
as separator).
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
trailer.c | 75 ---
1 file changed, 53 insertions(+), 22 del
"struct trailer_item" to be further
differentiated from "struct arg_item" in future patches.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
trailer.c | 135 +++---
1 file changed, 85 insertions(+), 50 deletion
On 10/20/2016 03:45 PM, Junio C Hamano wrote:
Jonathan Tan <jonathanta...@google.com> writes:
If we do that, there is also the necessity of creating a string that
combines the separators and '=' (I guess '\n' is not necessary now,
since all the lines are null terminated). I'm OK eith
On 10/20/2016 03:40 PM, Jonathan Tan wrote:
On 10/20/2016 03:14 PM, Junio C Hamano wrote:
Stefan Beller <sbel...@google.com> writes:
+static int find_separator(const char *line)
+{
+ const char *c;
+ for (c = line; ; c++) {
+ if (!*c || *c
On 10/20/2016 03:14 PM, Junio C Hamano wrote:
Stefan Beller writes:
+static int find_separator(const char *line)
+{
+ const char *c;
+ for (c = line; ; c++) {
+ if (!*c || *c == '\n')
+ return -1;
+ if (*c ==
"struct trailer_item" to be further
differentiated from "struct arg_item" in future patches.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
trailer.c | 135 +++---
1 file changed, 85 insertions(+), 50 deletion
Currently, creation and addition (to a list) of trailer items are spread
across multiple functions. Streamline this by only having 2 functions:
one to parse the user-supplied string, and one to add the parsed
information to a list.
Signed-off-by: Jonathan Tan <jonathanta...@google.
89f8808570e37fb90aa3
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
Documentation/git-interpret-trailers.txt | 5 +-
t/t7513-interpret-trailers.sh| 115 +++
trailer.c| 89
3 fil
Replace the existing handwritten implementation of a doubly-linked list
in trailer.c with the functions and macros from list.h. This
significantly simplifies the code.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
Signed-off-by: Ramsay Jones <ram...@ramsayjones.plus.com>
--
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 <jonathanta...@google.com>
---
Documentation/git-interpret-trailers.tx
.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
Documentation/git-interpret-trailers.txt | 7 +-
t/t7513-interpret-trailers.sh| 169 +++
trailer.c| 43 ++--
3 files changed, 210 insertions(+), 9 deletions(-)
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.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
trailer.
e existing behavior of ignoring comments, since the
number of trailers and non-trailers in the trailer block now
matters more
new->7/8:
- new patch
6/6->8/8:
- updated trailer block recognizing code, since the continuation
lines must not be counted if they follow a trai
Change "const char *" to "char *" in struct trailer_item and in the
return value of apply_command (since those strings are owned strings).
Change "struct conf_info *" to "const struct conf_info *" (since that
struct is not modified).
Signed-off-by
On 10/18/2016 09:36 AM, Junio C Hamano wrote:
Jonathan Tan <jonathanta...@google.com> writes:
* rs/c-auto-resets-attributes:
pretty: avoid adding reset for %C(auto) if output is empty
And neither of the two colon containing line remotely resembles how
a typical RFC-822
On 10/17/2016 06:42 PM, Junio C Hamano wrote:
Stefan Beller <sbel...@google.com> writes:
On Fri, Oct 14, 2016 at 10:38 AM, Jonathan Tan <jonathanta...@google.com> wrote:
Existing trailers are extracted from the input message by looking for
-a group of one or more lines that con
.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
Documentation/git-interpret-trailers.txt | 7 +-
t/t7513-interpret-trailers.sh| 139 +++
trailer.c| 22 +++--
3 files changed, 160 insertions(+), 8 del
/stable/linux-stable/+/e7d316a02f683864a12389f8808570e37fb90aa3
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
Documentation/git-interpret-trailers.txt | 3 +-
t/t7513-interpret-trailers.sh| 35 +++
trailer.c| 77 +++
"struct trailer_item" to be further
differentiated from "struct arg_item" in future patches.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
trailer.c | 135 +++---
1 file changed, 85 insertions(+), 50 deletion
Replace the existing handwritten implementation of a doubly-linked list
in trailer.c with the functions and macros from list.h. This
significantly simplifies the code.
Signed-off-by: Jonathan Tan <jonathanta...@google.com>
---
trailer.c
Currently, creation and addition (to a list) of trailer items are spread
across multiple functions. Streamline this by only having 2 functions:
one to parse the user-supplied string, and one to add the parsed
information to a list.
Signed-off-by: Jonathan Tan <jonathanta...@google.
Change "const char *" to "char *" in struct trailer_item and in the
return value of apply_command (since those strings are owned strings).
Change "struct conf_info *" to "const struct conf_info *" (since that
struct is not modified).
Signed-off-by
Ah, I knew I forgot something. These are exactly the same as v2, except
that these are signed off.
Jonathan Tan (6):
trailer: improve const correctness
trailer: use list.h for doubly-linked list
trailer: streamline trailer item create and add
trailer: make args have their own struct
Replace the existing handwritten implementation of a doubly-linked list
in trailer.c with the functions and macros from list.h. This
significantly simplifies the code.
---
trailer.c | 258 ++
1 file changed, 91 insertions(+), 167
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 "\na: b\nnot trailer" |
git interpret-trailers
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
Currently, creation and addition (to a list) of trailer items are spread
across multiple functions. Streamline this by only having 2 functions:
one to parse the user-supplied string, and one to add the parsed
information to a list.
---
trailer.c | 130
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.
Change "const char *" to "char *" in struct trailer_item and in the
return value of apply_command (since those strings are owned strings).
Change "struct conf_info *" to "const struct conf_info *" (since that
struct is not modified).
---
trailer.c | 14 +++---
1 file changed, 7
;char *" instead of "struct strbuf"
- Modified test slightly to test whitespace at beginning of line
Jonathan Tan (6):
trailer: improve const correctness
trailer: use list.h for doubly-linked list
trailer: streamline trailer item create and add
trailer: make args have their ow
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.
Also take the opportunity to refine the "struct
Currently, creation and addition (to a list) of trailer items are spread
across multiple functions. Streamline this by only having 2 functions:
one to parse the user-supplied string, and one to add the parsed
information to a list.
---
trailer.c | 135
901 - 1000 of 1061 matches
Mail list logo