LigH
17th November 2020, 12:58
I already asked it once in the x265 encoder thread, but there are still issues, and I don't want to clutter that thread more, so I'll prefer a separate thread.
When x265 used Mercurial (hg), I could use a simple shell script to update my local working directory to either the latest commit in the default branch, or the "tip" regardless of the branch, or a specific commit by checksum.
uptodate_x265.sh
#!/bin/sh
hg pull --cwd build/x265-hg -r "${1:-default}"
hg update --cwd build/x265-hg -r "${1:-default}"
Apparently, this worked due to the simplicity and flexibility of hg handling submitted parameters and deciding which meaning a parameter has.
I had to learn that I am not able to understand the meaning of all the parameters git offers to achieve the same result.
Until today I believed that the following script is able to ensure that my local working directory gets updated to the latest commit in the default branch:
uptodate_x265-git.sh
#!/bin/sh
git -C build/x265_git-git fetch -v --progress origin
git -C build/x265_git-git pull -v --no-rebase --progress origin master
But since I failed updating it to a specific revision by checksum with a modified script, until I ran a "git merge" command (which popped up a Vim which I don't want and need), I started to doubt that.
So I remain helpless. :confused:
It would be nice if I could have one script which does the same as my previous one, but won't mind if I have to split it into separate versions to handle default, tip, and revision-by-checksum-parameter in optimal sequences, to avoid complex case switches.
When x265 used Mercurial (hg), I could use a simple shell script to update my local working directory to either the latest commit in the default branch, or the "tip" regardless of the branch, or a specific commit by checksum.
uptodate_x265.sh
#!/bin/sh
hg pull --cwd build/x265-hg -r "${1:-default}"
hg update --cwd build/x265-hg -r "${1:-default}"
Apparently, this worked due to the simplicity and flexibility of hg handling submitted parameters and deciding which meaning a parameter has.
I had to learn that I am not able to understand the meaning of all the parameters git offers to achieve the same result.
Until today I believed that the following script is able to ensure that my local working directory gets updated to the latest commit in the default branch:
uptodate_x265-git.sh
#!/bin/sh
git -C build/x265_git-git fetch -v --progress origin
git -C build/x265_git-git pull -v --no-rebase --progress origin master
But since I failed updating it to a specific revision by checksum with a modified script, until I ran a "git merge" command (which popped up a Vim which I don't want and need), I started to doubt that.
So I remain helpless. :confused:
It would be nice if I could have one script which does the same as my previous one, but won't mind if I have to split it into separate versions to handle default, tip, and revision-by-checksum-parameter in optimal sequences, to avoid complex case switches.