aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git-interpret-trailers.txt
AgeCommit message (Collapse)AuthorFilesLines
2024-03-16doc: fix some placeholders formatingJean-Noël Avila1-3/+3
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> Acked-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-09-07trailer doc: <token> is a <key> or <keyAlias>, not bothLinus Arver1-60/+76
The `--trailer` option takes a "<token>=<value>" argument, for example --trailer "Acked-by=Bob" And in this exampple it is understood that "Acked-by" is the <token>. However, the user can use a shorter "ack" string by defining configuration like git config trailer.ack.key "Acked-by" However, in the docs we define the above configuration as trailer.<token>.key so the <token> can mean either the longer "Acked-by" or the shorter "ack". Separate the two meanings of <token> into <key> and <keyAlias>, and update the configuration syntax to say "trailer.<keyAlias>.key". Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-09-07trailer doc: separator within key suppresses default separatorLinus Arver1-2/+2
Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-09-07trailer doc: emphasize the effect of configuration variablesLinus Arver1-3/+6
The sentence does not mention the effect of configuration variables at all, when they are actively used by default (unless --parse is specified) to potentially add new trailers, without the user having to always supply --trailer manually. Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-09-07trailer --unfold help: prefer "reformat" over "join"Linus Arver1-2/+2
The phrase "join whitespace-continued values" requires some additional context. For example, "whitespace" means newlines (not just space characters), and "join" means to join only the multiple lines together for a single trailer (and not that we are joining multiple trailers together). That is, "join" means to convert token: This is a very long value, with spaces and newlines in it. to token: This is a very long value, with spaces and newlines in it. and does not mean to convert token: value1 token: value2 to token: value1 value2. Update the help text to resolve the above ambiguity. While we're add it, update the docs to use similar language as the change in the help text. Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-09-07trailer --parse docs: add explanation for its usefulnessLinus Arver1-2/+7
For users who are skimming the docs to go straight to the individual breakdown of each flag, it may not be clear why --parse is a convenience alias (without them also looking at the other options that --parse turns on). To save them the trouble of looking at the other options (and computing what that would mean), describe a summary of the overall effect. Similarly update the area when we first mention --parse near the top of the doc. Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-09-07trailer --only-input: prefer "configuration variables" over "rules"Linus Arver1-2/+2
Use the phrase "configuration variables" instead of "rules" because (1) we already say "configuration variables" in multiple places in the docs (where the word "rules" is only used for describing "--only-input" behavior and for an unrelated case of mentioning how the trailers do not follow "rules for RFC 822 headers"), and (2) this phrase is more specific than just "rules". Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-09-07trailer: trailer location is a place, not an actionLinus Arver1-1/+1
Fix the help text to say "placement" instead of "action" because the values are placements, not actions. While we're at it, tweak the documentation to say "placements" instead of "values", similar to how the existing language for "--if-exists" uses the word "action" to describe both the syntax (with the phrase "--if-exists <action>") and the possible values (with the phrase "possible actions"). Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-09-07trailer doc: narrow down scope of --where and related flagsLinus Arver1-3/+6
The wording "all configuration variables" is misleading (the same could be said to the descriptions of the "--[no-]if-exists" and the "--[no-]if-missing" options). Specifying --where=value overrides only the trailer.where variable and applicable trailer.<token>.where variables, and --no-where stops the overriding of these variables. Ditto for the other two with their relevant configuration variables. Reported-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-09-07trailer: add tests to check defaulting behavior with --no-* flagsLinus Arver1-4/+10
While the "--no-where" flag is tested, the "--no-if-exists" and "--no-if-missing" flags are not, so add tests for them. But also add tests for all "--no-*" flags to check their effects, both when (1) there are relevant configuration variables set, and (2) they are not set. Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-14doc: trailer: add more examples in DESCRIPTIONLinus Arver1-2/+18
Be more up-front about what trailers are in practice with examples, to give the reader a visual cue while they go on to read the rest of the description. Also add an example for multiline values. Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-14doc: trailer: mention 'key' in DESCRIPTIONLinus Arver1-1/+4
The 'key' option is used frequently in the examples at the bottom but there is no mention of it in the description. Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-14doc: trailer.<token>.command: emphasize deprecationLinus Arver1-2/+2
This puts the deprecation notice up front, instead of leaving it to the next paragraph. Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-14doc: trailer: use angle brackets for <token> and <value>Linus Arver1-4/+4
We already use angle brackets elsewhere, so this makes things more consistent. Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-14doc: trailer: remove redundant phrasingLinus Arver1-3/+2
The phrase "many rules" gets essentially repeated again with "many other rules", so remove this repetition. Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-14doc: trailer: examples: avoid the word "message" by itselfLinus Arver1-25/+25
Previously, "message" could mean the input, output, commit message, or "internal body text inside the commit message" (in the EXAMPLES section). Avoid overloading this term by using the appropriate meanings explicitly. Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-14doc: trailer: drop "commit message part" phrasingLinus Arver1-16/+20
The command can take inputs that are either just a commit message, or an email-like output such as git-format-patch which includes a commit message, "---" divider, and patch part. The existing explanation blends these two inputs together in the first sentence This command reads some patches or commit messages which then necessitates using the "commit message part" phrasing (as opposed to just "commit message") because the input is ambiguous per the above definition. This change separates the two input types and explains them separately, and so there is no longer a need to use the "commit message part" phrase. Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-14doc: trailer: swap verb orderLinus Arver1-1/+1
This matches the order already used in the NAME section. Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-14doc: trailer: fix grammarLinus Arver1-4/+4
Signed-off-by: Linus Arver <linusa@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-05-01doc: interpret-trailers: fix exampleKristoffer Haugsbakk1-3/+17
We need to provide `--trailer sign` since the command won’t output anything if you don’t give it an input and/or a `--trailer`. Furthermore, the message which already contains an s-o-b is wrong: $ git interpret-trailers --trailer sign <msg.txt Signed-off-by: Alice <alice@example.com> Signed-off-by: Alice <alice@example.com> This can’t be what was originally intended. So change the messages in this example to use the typical “subject/message” file. Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-05-01doc: interpret-trailers: don’t use deprecated configKristoffer Haugsbakk1-3/+6
`command` has been deprecated since commit c364b7ef51 (trailer: add new .cmd config option, 2021-05-03). Use the commit message of c364b7ef51 as a guide to replace the use of `$ARG` and to use a script instead of an inline command.[1] Also, explicitly trigger the command by passing in `--trailer=see`, since this config is not automatically used.[2] [1]: “Instead of "$ARG", users can refer to the value as positional argument, $1, in their scripts.” [2]: “At the same time, in order to allow `git interpret-trailers` to better simulate the behavior of `git command -s`, 'trailer.<token>.cmd' will not automatically execute.” Acked-by: ZheNing Hu <adlternative@gmail.com> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-05-01doc: interpret-trailers: use input redirectionKristoffer Haugsbakk1-1/+1
Use input redirection instead of invoking cat(1) on a single file. This is more straightforward, saves a process, and often makes the line shorter. Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-05-01doc: interpret-trailers: don’t use heredoc in examplesKristoffer Haugsbakk1-39/+35
This file contains four instances of trailing spaces from its inception in commit [1]. These spaces might be intentional, since a user would be prompted with `> ` in an interactive session. On the one hand, this is a whitespace error according to `git diff --check`; on the other hand, the raw documentation—it makes no difference in the rendered output—is just staying faithful to the simulation of the interactive prompt. Let’s get rid of these whitespace errors and also make the examples more friendly to cut-and-paste by replacing the heredocs with files which are shown with cat(1). [1]: dfd66ddf5a (Documentation: add documentation for 'git interpret-trailers', 2014-10-13) Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-10-28Merge branch 'ab/doc-synopsis-and-cmd-usage'Junio C Hamano1-2/+3
The short-help text shown by "git cmd -h" and the synopsis text shown at the beginning of "git help cmd" have been made more consistent. * ab/doc-synopsis-and-cmd-usage: (34 commits) tests: assert consistent whitespace in -h output tests: start asserting that *.txt SYNOPSIS matches -h output doc txt & -h consistency: make "worktree" consistent worktree: define subcommand -h in terms of command -h reflog doc: list real subcommands up-front doc txt & -h consistency: make "commit" consistent doc txt & -h consistency: make "diff-tree" consistent doc txt & -h consistency: use "[<label>...]" for "zero or more" doc txt & -h consistency: make "annotate" consistent doc txt & -h consistency: make "stash" consistent doc txt & -h consistency: add missing options doc txt & -h consistency: use "git foo" form, not "git-foo" doc txt & -h consistency: make "bundle" consistent doc txt & -h consistency: make "read-tree" consistent doc txt & -h consistency: make "rerere" consistent doc txt & -h consistency: add missing options and labels doc txt & -h consistency: make output order consistent doc txt & -h consistency: add or fix optional "--" syntax doc txt & -h consistency: fix mismatching labels doc SYNOPSIS & -h: use "-" to separate words in labels, not "_" ...
2022-10-13doc txt & -h consistency: add missing optionsÆvar Arnfjörð Bjarmason1-2/+3
Change those built-in commands that were attempting to exhaustively list the options in the "-h" output to actually do so, and always have *.txt documentation know about the exhaustive list of options. Let's also fix the documentation and -h output for those built-in commands where the *.txt and -h output was a mismatch of missing options on both sides. In the case of "interpret-trailers" fixing the missing options reveals that the *.txt version was implicitly claiming that the command had two operating modes, which a look at the -h version (and studying the documentation) will show is not the case. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-08-30Documentation: clarify whitespace rules for trailersChristian Couder1-4/+6
Commit e4319562bc (trailer: be stricter in parsing separators, 2016-11-02) restricted whitespaces allowed by `git interpret-trailers` in the "token" part of the trailers it reads. This commit didn't update the related documentation in Documentation/git-interpret-trailers.txt though. Also commit 60ef86a162 (trailer: support values folded to multiple lines, 2016-10-21) updated the documentation, but didn't make it clear how many whitespace characters are allowed at the beginning of new lines in folded values. Let's fix both of these issues by rewriting the paragraph describing what whitespaces are allowed by `git interpret-trailers` in the trailers it reads. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-05-04trailer: add new .cmd config optionZheNing Hu1-9/+66
The `trailer.<token>.command` configuration variable specifies a command (run via the shell, so it does not have to be a single name or path to the command, but can be a shell script), and the first occurrence of substring $ARG is replaced with the value given to the `interpret-trailer` command for the token in a '--trailer <token>=<value>' argument. This has three downsides: * The use of $ARG in the mechanism misleads the users that the value is passed in the shell variable, and tempt them to use $ARG more than once, but that would not work, as the second and subsequent $ARG are not replaced. * Because $ARG is textually replaced without regard to the shell language syntax, even '$ARG' (inside a single-quote pair), which a user would expect to stay intact, would be replaced, and worse, if the value had an unmatched single quote (imagine a name like "O'Connor", substituted into NAME='$ARG' to make it NAME='O'Connor'), it would result in a broken command that is not syntactically correct (or worse). * The first occurrence of substring `$ARG` will be replaced with the empty string, in the command when the command is first called to add a trailer with the specified <token>. This is a bad design, the nature of automatic execution causes it to add a trailer that we don't expect. Introduce a new `trailer.<token>.cmd` configuration that takes higher precedence to deprecate and eventually remove `trailer.<token>.command`, which passes the value as an argument to the command. Instead of "$ARG", users can refer to the value as positional argument, $1, in their scripts. At the same time, in order to allow `git interpret-trailers` to better simulate the behavior of `git command -s`, 'trailer.<token>.cmd' will not automatically execute. Helped-by: Junio C Hamano <gitster@pobox.com> Helped-by: Christian Couder <christian.couder@gmail.com> Signed-off-by: ZheNing Hu <adlternative@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-05-04docs: correct descript of trailer.<token>.commandZheNing Hu1-16/+21
In the original documentation of `trailer.<token>.command`, some descriptions are easily misunderstood. So let's modify it to increase its readability. In addition, clarify that `$ARG` in command can only be replaced once. Signed-off-by: ZheNing Hu <adlternative@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-04-01interpret-trailers.txt: start the desc line with a capital letterNguyễn Thái Ngọc Duy1-1/+1
This description line is shown in 'git help -a' and all other commands description starts with an uppercase character. This just makes that printout a bit nicer. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-09-17Merge branch 'jk/trailer-fixes'Junio C Hamano1-2/+8
"git interpret-trailers" and its underlying machinery had a buggy code that attempted to ignore patch text after commit log message, which triggered in various codepaths that will always get the log message alone and never get such an input. * jk/trailer-fixes: append_signoff: use size_t for string offsets sequencer: ignore "---" divider when parsing trailers pretty, ref-filter: format %(trailers) with no_divider option interpret-trailers: allow suppressing "---" divider interpret-trailers: tighten check for "---" patch boundary trailer: pass process_trailer_opts to trailer_info_get() trailer: use size_t for iterating trailer list trailer: use size_t for string offsets
2018-08-23interpret-trailers: allow suppressing "---" dividerJeff King1-1/+6
Even with the newly-tightened "---" parser, it's still possible for a commit message to trigger a false positive if it contains something like "--- foo". If the caller knows that it has only a single commit message, it can now tell us with the "--no-divider" option, eliminating any false positives. If we were designing this from scratch, I'd probably make this the default. But we've advertised the "---" behavior in the documentation since interpret-trailers has existed. Since it's meant to be scripted, breaking that would be a bad idea. Note that the logic is in the underlying trailer.c code, which is used elsewhere. The default there will keep the current behavior, but many callers will benefit from setting this new option. That's left for future patches. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-23interpret-trailers: tighten check for "---" patch boundaryJeff King1-2/+3
The interpret-trailers command accepts not only raw commit messages, but it also can manipulate trailers in format-patch output. That means it must find the "---" boundary separating the commit message from the patch. However, it does so by looking for any line starting with "---", regardless of whether there is further content. This is overly lax compared to the parsing done in mailinfo.c's patchbreak(), and may cause false positives (e.g., t/perf output tables uses dashes; if you cut and paste them into your commit message, it fools the parser). We could try to reuse patchbreak() here, but it actually has several heuristics that are not of interest to us (e.g., matching "diff -" without a three-dash separator or even a CVS "Index:" line). We're not interested in taking in whatever random cruft people may send, but rather handling git-formatted patches. Note that the existing documentation was written in a loose way, so technically we are changing the behavior from what it said. But this should implement the original intent in a more accurate way. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-15Merge branch 'sb/trailers-docfix'Junio C Hamano1-3/+6
Doc update. * sb/trailers-docfix: Documentation/git-interpret-trailers: explain possible values
2018-07-20Documentation/git-interpret-trailers: explain possible valuesStefan Beller1-3/+6
Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-05-25Use proper syntax for replaceables in command docsRobert P. J. Day1-2/+2
The standard for command documentation synopses appears to be: [...] means optional <...> means replaceable [<...>] means both optional and replaceable So fix a number of doc pages that use incorrect variations of the above. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-02-27Merge branch 'bc/doc-interpret-trailers-grammofix'Junio C Hamano1-1/+1
Docfix. * bc/doc-interpret-trailers-grammofix: docs/interpret-trailers: fix agreement error
2018-02-13docs/interpret-trailers: fix agreement errorbrian m. carlson1-1/+1
In the description of git interpret-trailers, we describe "a group…of lines" that have certain characteristics. Ensure both options describing this group use a singular verb for parallelism. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-26Merge branch 'jk/trailers-parse'Junio C Hamano1-7/+26
"git interpret-trailers" has been taught a "--parse" and a few other options to make it easier for scripts to grab existing trailer lines from a commit log message. * jk/trailers-parse: doc/interpret-trailers: fix "the this" typo pretty: support normalization options for %(trailers) t4205: refactor %(trailers) tests pretty: move trailer formatting to trailer.c interpret-trailers: add --parse convenience option interpret-trailers: add an option to unfold values interpret-trailers: add an option to show only existing trailers interpret-trailers: add an option to show only the trailers trailer: put process_trailers() options into a struct
2017-08-20doc/interpret-trailers: fix "the this" typoMartin Ågren1-1/+1
Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-15interpret-trailers: add --parse convenience optionJeff King1-7/+14
The last few commits have added command line options that can turn interpret-trailers into a parsing tool. Since they'd most often be used together, let's provide a convenient single option for callers to invoke this mode. This is implemented as a callback rather than a boolean so that its effect is applied immediately, as if those options had been specified. Later options can then override them. E.g.: git interpret-trailers --parse --no-unfold would work. Let's also update the documentation to make clear that this parsing mode behaves quite differently than the normal "add trailers to the input" mode. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-15interpret-trailers: add an option to unfold valuesJeff King1-0/+4
The point of "--only-trailers" is to give a caller an output that's easy for them to parse. Getting rid of the non-trailer material helps, but we still may see more complicated syntax like whitespace continuation. Let's add an option to unfold any continuation, giving the output as a single "key: value" line per trailer. As a bonus, this could be used even without --only-trailers to clean up unusual formatting in the incoming data. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-15interpret-trailers: add an option to show only existing trailersJeff King1-0/+5
It can be useful to invoke interpret-trailers for the primary purpose of parsing existing trailers. But in that case, we don't want to apply existing ifMissing or ifExists rules from the config. Let's add a special mode where we avoid applying those rules. Coupled with --only-trailers, this gives us a reasonable parsing tool. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-15interpret-trailers: add an option to show only the trailersJeff King1-0/+3
In theory it's easy for any reader who wants to parse trailers to do so. But there are a lot of subtle corner cases around what counts as a trailer, when the trailer block begins and ends, etc. Since interpret-trailers already has our parsing logic, let's let callers ask it to just output the trailers. They still have to parse the "key: value" lines, but at least they can ignore all of the other corner cases. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-14interpret-trailers: fix documentation typoPaolo Bonzini1-2/+2
Self-explanatory... trailer.ifexists is documented with the right name, but after a while it switches to ifexist. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-14interpret-trailers: add options for actionsPaolo Bonzini1-0/+23
Allow using non-default values for trailers without having to set them up in .gitconfig first. For example, if you have the following configuration trailer.signed-off-by.where = end you may use "--where before" when a patch author forgets his Signed-off-by and provides it in a separate email. Likewise for --if-exists and --if-missing Reverting to the behavior specified by .gitconfig is done with --no-where, --no-if-exists and --no-if-missing. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-23Documentation: fix reference to ifExists for interpret-trailersAndreas Heiduk1-1/+1
The manual for "git interpret-trailers" mentioned a non-existing literal `overwrite` for its config option `trailer.ifexists`. The correct name for that choice is `replace`. Signed-off-by: Andreas Heiduk <asheiduk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-21doc: mention user-configured trailersJonathan Tan1-1/+2
In commit 1462450 ("trailer: allow non-trailers in trailer block", 2016-10-21), functionality was added (and tested [1]) to allow non-trailer lines in trailer blocks, as long as those blocks contain at least one Git-generated or user-configured trailer, and consists of at least 25% trailers. The documentation was updated to mention this new functionality, but did not mention "user-configured trailer". Further update the documentation to also mention "user-configured trailer". [1] "with non-trailer lines mixed with a configured trailer" in t/t7513-interpret-trailers.sh Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-10-21trailer: support values folded to multiple linesJonathan Tan1-3/+4
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 <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-10-21trailer: forbid leading whitespace in trailersJonathan Tan1-1/+1
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 <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-10-21trailer: allow non-trailers in trailer blockJonathan Tan1-2/+3
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 <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-28doc: typeset long command-line options as literalMatthieu Moy1-1/+1
Similarly to the previous commit, use backquotes instead of forward-quotes, for long options. This was obtained with: perl -pi -e "s/'(--[a-z][a-z=<>-]*)'/\`\$1\`/g" *.txt and manual tweak to remove false positive in ascii-art (o'--o'--o' to describe rewritten history). Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-14interpret-trailers: add option for in-place editingTobias Klauser1-1/+23
Add a command line option --in-place to support in-place editing akin to sed -i. This allows to write commands like the following: git interpret-trailers --trailer "X: Y" a.txt > b.txt && mv b.txt a.txt in a more concise way: git interpret-trailers --trailer "X: Y" --in-place a.txt Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-15Merge branch 'tk/doc-interpret-trailers-grammo'Junio C Hamano1-1/+1
* tk/doc-interpret-trailers-grammo: Documentation/interpret-trailers: Grammar fix
2015-10-07Documentation/interpret-trailers: Grammar fixTobias Klauser1-1/+1
Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-11-04Documentation: typofixesThomas Ackermann1-3/+3
In addition to fixing trivial and obvious typos, be careful about the following points: - Spell ASCII, URL and CRC in ALL CAPS; - Spell Linux as Capitalized; - Do not omit periods in "i.e." and "e.g.". Signed-off-by: Thomas Ackermann <th.acker@arcor.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-10-13Documentation: add documentation for 'git interpret-trailers'Christian Couder1-0/+314
While at it add git-interpret-trailers to "command-list.txt". Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>