Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to unshelve changes using git-p4

Latest git-p4 script (https://github.com/ermshiperete/git-p4) has a "shelve" but no "unshelve" command. How do I unshelve changes using it?

like image 942
Paweł Krupiński Avatar asked Nov 15 '12 15:11

Paweł Krupiński


2 Answers

Doesn't look like you can, though git p4, instead you'll need to do it through Perforce.

like image 148
Douglas Leeder Avatar answered Oct 21 '22 02:10

Douglas Leeder


Since Git 2.18 (Q2 2018), there is a git p4 unshelve command

Unshelving will take a shelved P4 changelist, and produce the equivalent git commit in the branch refs/remotes/p4/unshelved/<changelist>.

But it was flawed:

The "unshelve" subcommand of "git p4(man)" used incorrectly used commit^N where it meant to say commit~N to name the Nth generation ancestor, which has been corrected with Git 2.29 (Q4 2020).

See commit 0acbf59, commit 677fa8d (19 Sep 2020) by Luke Diamand (ldiamand42).
(Merged by Junio C Hamano -- gitster -- in commit 9f4588d, 25 Sep 2020)

git-p4 unshelve: adding a commit breaks git-p4 unshelve

Signed-off-by: Luke Diamand

git-p4 unshelve uses HEAD^$n to find the parent commit, which fails if there is an additional commit.

like image 39
VonC Avatar answered Oct 21 '22 04:10

VonC