1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p curl common-updater-scripts jq git
6 oldVersion
="$(nix-instantiate --eval -E "with import .
/.
{}; lib.getVersion git
" | tr -d '"')"
7 latestTag="$(git ls-remote --tags --sort="v:refname" https://github.com/git/git.git | grep -v '\
{\
}' | grep -v '\
-rc' | tail -1 | sed 's|^.
*/v\
(.
*\
)|\
1|
')"
8 targetVersion="${1:-$latestTag}"
10 if [ ! "${oldVersion}" = "${targetVersion}" ]; then
11 update-source-version git "${targetVersion}"
12 nixpkgs="$(git rev-parse --show-toplevel)"
13 default_nix="$nixpkgs/pkgs/applications/version-management/git-and-tools/git/default.nix"
15 git add "${default_nix}"
16 git commit -m "git: ${oldVersion} -> ${targetVersion}"
18 echo "git is already up-to-date"