git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Sina Siadat <siadat@gmail.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [PATCH] git-add-interactive: edit current file in editor
Date: Wed, 29 Jul 2015 15:05:02 -0400	[thread overview]
Message-ID: <CAPig+cRRda=DVGAqpUjOsFk9Fqjqxi-apvWLuEW5xK1XCu5_+g@mail.gmail.com> (raw)
In-Reply-To: <1438040482-4599-1-git-send-email-siadat@gmail.com>

Aside from whether or not this change is desirable, see a few pointers
below to improve the patch...

On Monday, July 27, 2015, Sina Siadat <siadat@gmail.com> wrote:
> Adds a new option 'o' to the 'add -p' command that lets you open and edit the
> current file.

Imperative mood: "Add a new option..."

> The existing 'e' mode is used to manually edit the hunk.  The new 'o' option
> allows you to open and edit the file without having to quit the loop. The hunks
> are updated when the editing is done, and the user will be able to review the
> updated hunks.  Without this option you would have to quit the loop, edit the
> file, and execute 'add -p filename' again.

This descriptive material belongs in the commit message. Good.

> I would appreciate it if you could let me know what you think about this
> option. I will write more tests if there is any interest at all.

This, however, is commentary, which, while useful as part of the
submission process, does not belong in the commit message. Therefore,
it should be placed below the "---" line just before the diffstat.

> Thank you. :)

Missing sign-off. See Documentation/SubmittingPatches.

More below...

> ---
> diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
> index deae948..e5dd1c6 100755
> --- a/t/t3701-add-interactive.sh
> +++ b/t/t3701-add-interactive.sh
> @@ -98,6 +98,12 @@ test_expect_success 'dummy edit works' '
>         test_cmp expected diff
>  '
>
> +test_expect_success 'dummy open works' '
> +       (echo o; echo a) | git add -p &&

Some alternatives, which may or may not read better, but at least
avoid a process creation or two:

    { echo o; echo a; } | git add -p &&

    printf "%s\n" o a | git add -p &&

    printf "o\na\n" | git add -p &&

Those are just suggestions; not necessarily a request for change.

> +       git diff > diff &&

Style: >diff

> +       test_cmp expected diff
> +'
> +
>  test_expect_success 'setup patch' '
>  cat >patch <<EOF
>  @@ -1,1 +1,4 @@
> --
> 2.5.0.rc3.2.g6f9504c.dirty

      parent reply	other threads:[~2015-07-29 19:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27 23:41 [PATCH] git-add-interactive: edit current file in editor Sina Siadat
2015-07-28  5:12 ` Jacob Keller
2015-07-29 19:05 ` Eric Sunshine [this message]

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='CAPig+cRRda=DVGAqpUjOsFk9Fqjqxi-apvWLuEW5xK1XCu5_+g@mail.gmail.com' \
    --to=sunshine@sunshineco.com \
    --cc=git@vger.kernel.org \
    --cc=siadat@gmail.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).