From: Ping Yin <pkufranky@gmail.com>
To: Johannes Schindelin <johannes.schindelin@gmx.de>
Cc: git@vger.kernel.org, gitster@pobox.com,
Sverre Rabbelier <srabbelier@gmail.com>
Subject: Re: [PATCH] git-add: introduce --edit (to edit the diff vs. the index)
Date: Fri, 10 Apr 2009 10:03:19 +0800 [thread overview]
Message-ID: <46dff0320904091903p57df51c8ice90648ab7a4baa6@mail.gmail.com> (raw)
In-Reply-To: <46dff0320904091843p3e034647j3c78506b4d0c2b4@mail.gmail.com>
On Fri, Apr 10, 2009 at 9:43 AM, Ping Yin <pkufranky@gmail.com> wrote:
> How about this?
> 'add --edit=patch' to edit the patch and "add --edit=index" to edit the index
>
One usecase for edit index
After a big change in foo.c in the worktree, you find a typo in foo.c.
You want to fix the typo first before commit the big change. But the
change is so big that you can't just fix the typo in worktree foo.c
and then use "add -p" to pick the typo fix first.
So you can
git stash
fix typo and commit
git stash apply and resolve the conflict
With 'add --edit=patch', you can
git add --edit=patch foo.c
an editor is fired up with the foo.c in index and worktree open side
by side. And you can fix the typo in both index and worktree file.
When exiting the editor, the index file is modified, and no conflict
to resolve.
next prev parent reply other threads:[~2009-04-10 2:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1239225986u.git.johannes.schindelin@gmx.de>
2009-04-08 21:30 ` [PATCH] git-add: introduce --edit (to edit the diff vs. the index) Johannes Schindelin
2009-04-08 21:32 ` Sverre Rabbelier
2009-04-09 2:00 ` Ping Yin
2009-04-10 1:43 ` Ping Yin
2009-04-10 2:03 ` Ping Yin [this message]
2009-04-10 18:10 ` Johannes Schindelin
2009-04-10 18:59 ` Sverre Rabbelier
2009-04-13 16:19 ` Johannes Schindelin
2009-04-13 16:59 ` Sverre Rabbelier
2009-04-11 1:11 ` Ping Yin
2009-04-13 16:21 ` Johannes Schindelin
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=46dff0320904091903p57df51c8ice90648ab7a4baa6@mail.gmail.com \
--to=pkufranky@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=johannes.schindelin@gmx.de \
--cc=srabbelier@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).