Closed sarcasticadmin closed 4 years ago
My test run:
[freshports@devgit-ingress01 ~/ports-jail/var/db/repos/PORTS-head-git]$ git fetch origin
remote: Enumerating objects: 284, done.
remote: Counting objects: 100% (284/284), done.
remote: Compressing objects: 100% (153/153), done.
remote: Total 300 (delta 147), reused 268 (delta 131), pack-reused 16
Receiving objects: 100% (300/300), 601.62 KiB | 7.16 MiB/s, done.
Resolving deltas: 100% (147/147), completed with 69 local objects.
From https://github.com/freebsd/freebsd-ports
008e30ab98fb..51d2aed475f4 master -> origin/master
f412caa04aa1..07bb2c7e524a branches/2020Q2 -> origin/branches/2020Q2
a70ca3962b88..94111c0e989c svn_head -> origin/svn_head
$ STARTPOINT=$(git log master..origin/master --oneline --reverse | head -n 1 | cut -d' ' -f1)
$ echo $STARTPOINT
01347222477d
$ git rebase origin/master
Successfully rebased and updated refs/heads/master.
The next test, is the revlist:
$ git rev-list $STARTPOINT..HEAD
51d2aed475f44b3835a3c180266636257f9c7037
944d2f0c310bc89399f00aca0a1b635cb1d41c6d
83a5c9b40d076bb9562ee48d748eb8d3e22c5d81
70ede099c6a26bf0f19c0e816aa9d8bbd8b1b961
3dc471ded667ab45e7be0314b1cf6db44cc901b3
373c576ab3099536a3e0fce79bf73ac4c00fa1ba
385e1ace7c5fab291f2590ccd934b4fb7c76fa06
f4fc414bacd7980e7dd6b3d9e68dd8e211c2e046
d21e632df7c2517268875d349e5a7966e78a3efd
e3c8eb9ccab4bf3d11ac83ad42d559b332f51f6c
112b8bf9408d27a7cae294620649fde510e650bd
2f2a0769a4470d1acb8afe33583ed876f3864521
0e07387774643c088ede7a6b4026a6b997dd92a7
27d1aaca54cb95bafa07a24729d04ba0e3df8dd7
738cc68d6faca71656ed04ae4bd2eca9bac8b6ae
6e2f80f27c0a9df22740d4dccf364eec97f0d974
d84306dddb0ef1bb2c248b7816b9e4aa10caa573
1e038b0fb77d6ab3f961c292bc029404c4c8ec2f
31c682c7046cca03cce6a3d9693d6b66a548ba86
a43594e02bf66ea831f3f6007a6af849e0e38557
abedb312dc01495d6e51cc1e061a1168e2751226
2b9459769919758413beea86bda9d1f67fa48752
1ffec389b40b928d1699c9a277a64ffeb62730c4
e0284c5c3e092606af58489042035aa50d324f8f
348e5320ff8048ca88a2651927d0a299ea278a42
4bd67a5b7556e4228aa02e68bb5ed0fdb171d298
4654270415f661c68dc2a71958115af6b576ca7c
f2c790d8d52aad3d7aac3021637d308dc47f9a52
e6b3f87f95478ffb64692d1b8a3ff0ffc1b89079
3c6614cb0266bd8336bd7e7c241b1e717fcc58d4
Thanks.
BTW, you mentioned "without having to embedded a commit SHA in the code " - git-show-commit.sh
was a proof of concept to verify iteration could happen. When expanded, it would not have had a hardcoded hash.
With your example, I see how we can use master
and $REMOTE/master
to leap-frog ahead.
Thank you.
@dlangille awesome, happy to help!
BTW, you mentioned "without having to embedded a commit SHA in the code " - git-show-commit.sh was a proof of concept to verify iteration could happen. When expanded, it would not have had a hardcoded hash.
Ya, understood. I just wanted to point out that the repo has all the info you need.
Thanks for all the work you've done with Freshports, I use it daily!
For testing purposes, how can I reset this? I could use zfs snapshot/rollback
but is there a way to reset my working copy repo back so I can do the same thing again?
Absolutely @dlangille you can the following:
# Make sure we are on the master branch
git checkout master
# Go back to a specific hash
git reset --hard COMMITHASH
Just substitute the COMMITHASH
for the hash you originally started from.
Confirmed. Just did this. Thanks.
@sarcasticadmin Thank you for your help. I appreciate it.
Description
@dlangille following up from our conversation earlier today: https://twitter.com/sarcasticadmin/status/1278075104417603584
I know in your initial examples you have the commit hash that youll be updating each time you run this script. Wanted to also point out that you could alternatively leverage some of the built-in functionality in
git
to do this without having to embedded a commit SHA in the code.Below is a script for updating freesbd-ports. It assumes that the repo is already cloned down although that could be handled here too if desired. But the idea is that since you have a local copy of the remote master branch and a local master you can diff them to see where you last left on the git log to xml conversion and then just run the conversion as you typically would.
git-delta.sh
:Example
The following is an example I had from a local ports tree. I have
git-delta.sh
in the same dir as the rest of the ports tree. Set ports treemaster
so some old commit. This commits from Jan:Run the delta:
Looking at
d475beb9e713
its the next commit in the tree afterd3b56095dd0e
:Hope this is helpful!