Robin Moffatt
03/15/2023, 12:30 PMbranch revert
docs and trying to do a revert, but hitting an unclear error.
I want to rollback the last commit (ideally without having to look up its specific ID). Is that possible?
$ lakectl branch revert <lakefs://quickstart/main> HEAD~1
Branch: <lakefs://quickstart/main>
Are you sure you want to revert the effect of commits HEAD~1: y
get commit from ref HEAD~1: not found
404 Not Found
Barak Amar
03/15/2023, 12:35 PMmain~1
Robin Moffatt
03/15/2023, 12:44 PM$ lakectl branch revert <lakefs://quickstart/main> main~1
Branch: <lakefs://quickstart/main>
Are you sure you want to revert the effect of commits main~1: y
update branch: conflict found
409 Conflict
Barak Amar
03/15/2023, 12:44 PMRobin Moffatt
03/15/2023, 12:45 PMBarak Amar
03/15/2023, 12:52 PMRobin Moffatt
03/15/2023, 1:04 PM$ lakectl log <lakefs://quickstart/main>
ID: 3c6d7270bbcec2d5c0f477b06cb143953d4aad0a24bb79981fa714d3257b8e0d
Author: admin
Date: 2023-03-15 08:25:34 +0000 UTC
Merge: 55f9b17656e4c2e5a1f783d14d4567d391cb4f47cf3f1cdb1e65bc51a53b8611, f6436033e20a5f0769c090f59765abf8bac3075b03541e3614f0a681acc09fa3
Merge 'denmark-lakes' into 'main'
Metadata:
.lakefs.merge.strategy = default
ID: f6436033e20a5f0769c090f59765abf8bac3075b03541e3614f0a681acc09fa3
Author: admin
Date: 2023-03-15 08:25:23 +0000 UTC
Create a dataset of just the lakes in Denmark
ID: 55f9b17656e4c2e5a1f783d14d4567d391cb4f47cf3f1cdb1e65bc51a53b8611
Author: admin
Date: 2023-03-15 08:22:19 +0000 UTC
Load sample data
ID: 84f5331e226955df56ce810bded5ff702c4b0fae8cd2bc17d4f82736e3cfd9da
Date: 2023-03-15 08:22:19 +0000 UTC
Repository created
$ lakectl branch revert <lakefs://quickstart/main> main
Branch: <lakefs://quickstart/main>
Are you sure you want to revert the effect of commits main: y
must specify 1-based parent number for reverting merge commit
409 Conflict
(using main
as the last argument)Barak Amar
03/15/2023, 2:10 PMRobin Moffatt
03/15/2023, 2:12 PMlog
output)?
And is it any merge that can't be reverted, or just this case here with two parents?Barak Amar
03/15/2023, 2:13 PMRobin Moffatt
03/15/2023, 2:14 PMBarak Amar
03/15/2023, 2:17 PM-m 1
for first parentmain~1
should work in your case - but I think you already run it and found a conflictmain -m 1
will probably give the same result, can you verify?Robin Moffatt
03/15/2023, 2:20 PM$ lakectl branch revert <lakefs://quickstart/main> main -m 1
Branch: <lakefs://quickstart/main>
Are you sure you want to revert the effect of commits main: y
commit main successfully reverted
no error! let me just check what it's doneBarak Amar
03/15/2023, 2:20 PMRobin Moffatt
03/15/2023, 2:21 PMID: f6436033e20a5f0769c090f59765abf8bac3075b03541e3614f0a681acc09fa3
Author: admin
Date: 2023-03-15 08:25:23 +0000 UTC
Create a dataset of just the lakes in Denmark
this was a commit that I made in another branch - so why would it show up in the log for main
?Barak Amar
03/15/2023, 2:24 PMRobin Moffatt
03/15/2023, 2:24 PMBarak Amar
03/15/2023, 2:24 PMRobin Moffatt
03/15/2023, 2:24 PMBarak Amar
03/15/2023, 2:25 PM