threads / discuss / 2919

"p4 revert -a" equivalent in git?

Subject: "p4 revert -a" equivalent in git?

## tl;dr

3 messages between Dec 24, 2005 and Dec 24, 2005.

replies: 2people: 2as markdown or json

Luben Tuikov· Dec 24, 2005, 00:13 UTC · lore
Hi,

Is there a "p4 revert -a" equivalent in git or should I whip up a script using git-diff-index and git-update-index?

That is I want to git-update-index --refresh for all files whose inode may have changed but the actual file data has not (i.e. git-diff-index is empty).

Thanks,
   Luben
Junio C Hamano· Dec 24, 2005, 00:23 UTC · re: Luben Tuikov · lore

Re: "p4 revert -a" equivalent in git?

Luben Tuikov <ltuikov@yahoo.com> writes:
> That is I want to git-update-index --refresh for all
> files whose inode may have changed but the actual file
> data has not.

That's what "git-update-index --refresh" does, unless I am misreading what you say you want.

	$ git checkout master
        $ touch *.c
	$ git diff-index HEAD ;# tons of changes
        $ git update-index --refresh
	$ git diff-index HEAD ;# no changes
Luben Tuikov· Dec 24, 2005, 00:36 UTC · re: Junio C Hamano · lore

Re: "p4 revert -a" equivalent in git?

--- Junio C Hamano <junkio@cox.net> wrote:
Show 8 quoted lines
> That's what "git-update-index --refresh" does, unless I am
> misreading what you say you want.
> 
> 	$ git checkout master
>         $ touch *.c
> 	$ git diff-index HEAD ;# tons of changes
>         $ git update-index --refresh
> 	$ git diff-index HEAD ;# no changes

Ok, thanks. I wasn't sure if I had to specify the file names on the command line of "git-update-index --refresh". It looks like I don't have to, so this is a perfect equivalent.

Thanks,
   Luben

← back to recent threads