Re: Any way to edit the file in index directly?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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_.

Hth,
Dscho

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]