git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tobias Klauser <tklauser@distanz.ch>
To: Junio C Hamano <gitster@pobox.com>,
	Christian Couder <chriscool@tuxfamily.org>
Cc: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
	Eric Sunshine <sunshine@sunshineco.com>,
	git@vger.kernel.org
Subject: [PATCH v4 0/2] Add in-place editing support to git interpret-trailers
Date: Thu, 14 Jan 2016 17:57:53 +0100	[thread overview]
Message-ID: <1452790676-11937-1-git-send-email-tklauser@distanz.ch> (raw)

This patch series adds support for in-place editing to git
interpret-trailers akin to sed -i, perl -i.

v3->v4:
 - Reword a test title, as suggested by Eric Sunshine.
 - Add a test to verify that the original file is not clobbered/deleted
   on error, as suggested by Eric Sunshine.
 - Move code specific to in-place editing from process_trailers() into a
   separate function to keep the overall flow clean. Suggested by Eric
   Sunshine.
 - Drop unnecessary braces, as pointed out by Eric Sunshine.
 - Use a more meaningful title for patch 1/2. Suggested by Junio Hamano.

v2->v3:
 - Rephrase two error messages according to the suggestions by Matthieu
   Moy.

v1->v2:
 - Split patch to make review easier, as suggested by Matthieu Moy.
 - Rename FILE * function parameters to a more readable name, as
   suggested by Matthieu Moy.
 - Write output to temporary file and rename after successfully written
   in full to avoid losing the original file in case of an
   error/interrupt. Pointed out by Eric Sunshine.

Tobias Klauser (2):
  trailer: allow to write to files other than stdout
  interpret-trailers: add option for in-place editing

 Documentation/git-interpret-trailers.txt | 24 ++++++++++-
 builtin/interpret-trailers.c             | 13 ++++--
 t/t7513-interpret-trailers.sh            | 40 ++++++++++++++++++
 trailer.c                                | 69 +++++++++++++++++++++++++-------
 trailer.h                                |  3 +-
 5 files changed, 129 insertions(+), 20 deletions(-)

-- 
2.7.0.1.g5e091f5

             reply	other threads:[~2016-01-14 16:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-14 16:57 Tobias Klauser [this message]
2016-01-14 16:57 ` [PATCH v4 1/2] trailer: allow to write to files other than stdout Tobias Klauser
2016-01-14 16:57 ` [PATCH v4 2/2] interpret-trailers: add option for in-place editing Tobias Klauser
2016-01-14 20:45   ` Junio C Hamano
2016-01-15 10:34     ` Tobias Klauser
2016-01-15 17:24       ` Junio C Hamano
2016-01-15 17:45         ` Tobias Klauser
2016-01-18 21:11     ` Eric Sunshine
     [not found]       ` <CAPc5daWpnReWJzeTJjvZap78H0oZKG-YGEP19Neusyahu5A6cQ@mail.gmail.com>
2016-01-18 22:13         ` Eric Sunshine
2016-01-19  8:28           ` Tobias Klauser
2016-01-19 17:52       ` Junio C Hamano
2016-01-19 17:56         ` Eric Sunshine
2016-01-19 18:10           ` Eric Sunshine
2016-01-19 20:58             ` Junio C Hamano
2016-01-19 21:45               ` Eric Sunshine
2016-01-19 22:09                 ` Junio C Hamano
2016-01-20  0:20                   ` Eric Sunshine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1452790676-11937-1-git-send-email-tklauser@distanz.ch \
    --to=tklauser@distanz.ch \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).