Last active
March 25, 2026 04:39
-
-
Save hymkor/02a0948e0a5be28002285d9acda2e786 to your computer and use it in GitHub Desktop.
jj-vcs/jj で更新日時が最も新しい bookmark を、`@-` もしくは引数で与えられたチェンジまで移動させた後、GitHub へ push するバッチファイル
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| setlocal | |
| set "PROMPT=$G " | |
| for /F %%I in ('jj log -r "latest(::@ & bookmarks())" --no-graph --template "self.bookmarks()"') do set "BOOKMARK=%%I" | |
| if "%~1" == "" ( | |
| set "REV=@-" | |
| ) else ( | |
| set "REV=%~1" | |
| ) | |
| jj log -r "%BOOKMARK%::%REV%" | |
| call :step jj bookmark move "%BOOKMARK%" -t "%REV%" | |
| call :step jj git push | |
| endlocal | |
| exit /b 0 | |
| :step | |
| set /P "YESNO=%* ? " | |
| if "%YESNO%" == "y" ( | |
| @echo on | |
| %* | |
| @echo off | |
| exit /b 0 | |
| ) else if "%YESNO%" == "n" ( | |
| echo Cancel: %* | |
| exit /b 0 | |
| ) | |
| goto :step | |
| rem gist https://gist.github.com/hymkor/02a0948e0a5be28002285d9acda2e786 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment