From e1f898639e906158fec26bdf3111d6f623288fa1 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 14 Jan 2016 17:57:55 +0100 Subject: interpret-trailers: add option for in-place editing 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 Signed-off-by: Junio C Hamano --- Documentation/git-interpret-trailers.txt | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/git-interpret-trailers.txt b/Documentation/git-interpret-trailers.txt index 0ecd497c4d..a77b901f1d 100644 --- a/Documentation/git-interpret-trailers.txt +++ b/Documentation/git-interpret-trailers.txt @@ -8,7 +8,7 @@ git-interpret-trailers - help add structured information into commit messages SYNOPSIS -------- [verse] -'git interpret-trailers' [--trim-empty] [(--trailer [(=|:)])...] [...] +'git interpret-trailers' [--in-place] [--trim-empty] [(--trailer [(=|:)])...] [...] DESCRIPTION ----------- @@ -64,6 +64,9 @@ folding rules, the encoding rules and probably many other rules. OPTIONS ------- +--in-place:: + Edit the files in place. + --trim-empty:: If the part of any trailer contains only whitespace, the whole trailer will be removed from the resulting message. @@ -216,6 +219,25 @@ Signed-off-by: Alice Signed-off-by: Bob ------------ +* Use the '--in-place' option to edit a message file in place: ++ +------------ +$ cat msg.txt +subject + +message + +Signed-off-by: Bob +$ git interpret-trailers --trailer 'Acked-by: Alice ' --in-place msg.txt +$ cat msg.txt +subject + +message + +Signed-off-by: Bob +Acked-by: Alice +------------ + * Extract the last commit as a patch, and add a 'Cc' and a 'Reviewed-by' trailer to it: + -- cgit v1.2.3