From: Ping Yin <pkufranky@gmail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Jeff King <peff@peff.net>, git mailing list <git@vger.kernel.org>
Subject: Re: Any way to edit the file in index directly?
Date: Wed, 8 Apr 2009 12:17:59 +0800 [thread overview]
Message-ID: <46dff0320904072117x712f29dj6854ee7219aede9d@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.1.00.0904080434240.10279@pacific.mpi-cbg.de>
On Wed, Apr 8, 2009 at 10:39 AM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
> On Tue, 7 Apr 2009, Jeff King wrote:
>
>> On Wed, Apr 08, 2009 at 09:03:03AM +0800, Ping Yin wrote:
>>
>> > There seems to be a patch for this ( add -e?), but i forget where to
>> > find it.
>>
>> "add -p" has an "e"dit option for editing the patch. I don't recall any
>> way of directly editing the content.
>
> I posted a patch for "git add --edit", which allows you to edit the _diff_
> between the working directory and the index, and which applies the result
> using apply --recount.
>
> But that has nothing to do with "editing the index directly".
>
> But you might want to use a combination of "hash-object -w --stdin" and
> "update-index --cacheinfo". IOW something like
>
> sha1=$(echo Hello | git hash-object -w --stdin) &&
> git update-index --cacheinfo 0644 $sha1 my-file
>
> However, Ping, I _strongly_ suspect an X-Y problem here. IOW I think you
> are asking about specifics of a certain _solution_, while we probably have
> a better solution for your particular _problem_.
>
Thanks. I think 'add --edit' is just what i meant by saying 'add -e'.
I'll have it a try.
prev parent reply other threads:[~2009-04-08 4:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-08 1:03 Any way to edit the file in index directly? Ping Yin
2009-04-08 2:10 ` Jeff King
2009-04-08 2:16 ` Jeff King
2009-04-08 2:27 ` Ping Yin
2009-04-08 5:44 ` Markus Heidelberg
2009-04-08 2:39 ` Johannes Schindelin
2009-04-08 4:17 ` Ping Yin [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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46dff0320904072117x712f29dj6854ee7219aede9d@mail.gmail.com \
--to=pkufranky@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).