1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-22 04:10:07 +00:00

Squashed 'gitstatus/' changes from 113f1f69..96b520b2

96b520b2 build v1.5.1 binaries for all platforms
ffeb0507 bump version to v1.5.1
1bcbea07 mbuild: disable pacman upgrades on msys
39dbb92f log a warning if unable to parse packed-refs
a9d70ec0 add `-r` flag to gitstatus_start in bash bindings (#241)
abbf9a79 don't use static_assert with one argument as it's not available prior to c++17 (#239)
f8c396e4 drop all tags if packed-refs doesn't have a header line (https://github.com/romkatv/powerlevel10k/issues/1428)

git-subtree-dir: gitstatus
git-subtree-split: 96b520b248ca872646e27b3df4535898356e4637
This commit is contained in:
Roman Perepelitsa 2021-06-10 10:15:02 +02:00
parent ba83466e1d
commit 96f3ca1733
6 changed files with 64 additions and 35 deletions

View file

@ -3,7 +3,7 @@
#
# This value is also read by shell bindings (indirectly, through
# ./install) when using GITSTATUS_DAEMON or usrbin/gitstatusd.
gitstatus_version="v1.5.0"
gitstatus_version="v1.5.1"
# libgit2 is a build time dependency of gitstatusd. The values of
# libgit2_version and libgit2_sha256 are read by ./build.

View file

@ -35,6 +35,11 @@
#
# -D Unless this option is specified, report zero staged, unstaged and conflicted
# changes for repositories with bash.showDirtyState = false.
#
# -r INT Close git repositories that haven't been used for this many seconds. This is
# meant to release resources such as memory and file descriptors. The next request
# for a repo that's been closed is much slower than for a repo that hasn't been.
# Negative value means infinity. The default is 3600 (one hour).
function gitstatus_start() {
if [[ "$BASH_VERSION" < 4 ]]; then
>&2 printf 'gitstatus_start: need bash version >= 4.0, found %s\n' "$BASH_VERSION"
@ -48,10 +53,10 @@ function gitstatus_start() {
fi
unset OPTIND
local opt timeout=5 max_dirty=-1 extra_flags
local opt timeout=5 max_dirty=-1 ttl=3600 extra_flags
local max_num_staged=1 max_num_unstaged=1 max_num_conflicted=1 max_num_untracked=1
local ignore_status_show_untracked_files
while getopts "t:s:u:c:d:m:eUWD" opt; do
while getopts "t:s:u:c:d:m:r:eUWD" opt; do
case "$opt" in
t) timeout=$OPTARG;;
s) max_num_staged=$OPTARG;;
@ -59,6 +64,7 @@ function gitstatus_start() {
c) max_num_conflicted=$OPTARG;;
d) max_num_untracked=$OPTARG;;
m) max_dirty=$OPTARG;;
r) ttl=$OPTARG;;
e) extra_flags+='--recurse-untracked-dirs ';;
U) extra_flags+='--ignore-status-show-untracked-files ';;
W) extra_flags+='--ignore-bash-show-untracked-files ';;
@ -113,6 +119,7 @@ function gitstatus_start() {
--max-num-conflicted="$max_num_conflicted"
--max-num-untracked="$max_num_untracked"
--dirty-max-index-size="$max_dirty"
--repo-ttl-seconds="$ttl"
$extra_flags)
tmpdir="$(command mktemp -d "${TMPDIR:-/tmp}"/gitstatus.bash.$$.XXXXXXXXXX)" || return

View file

@ -8,27 +8,27 @@
# work fine.
# Official gitstatusd binaries.
uname_s_glob="cygwin_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="c96baef70b81b5a1d46adcc9e93721eaf4bdc295562bdd2baf210a6b416b9911";
uname_s_glob="cygwin_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="18b5be49f6eb9ff1cf25e76d6f2333c7402e686e05ce5b88ca107c80504210d8";
uname_s_glob="darwin"; uname_m_glob="arm64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="0394e2ac880c1e190ace0346499d4670861297ecc2f84315ecb8ba3c98aa68d9";
uname_s_glob="darwin"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="26d582fe9a0b2090c28e84e5e32a6d42d6988cedff51e41ec5f789512c53b0fc";
uname_s_glob="freebsd"; uname_m_glob="amd64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="54a823373458a0908187ba8d1c5b8921015c844811916451674cc09fbdff88bb";
uname_s_glob="linux"; uname_m_glob="aarch64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="4e0a506eafb14b009cf6670f0e11399ac7e765cad17b9fcf38ef65516d248bfa";
uname_s_glob="linux"; uname_m_glob="armv6l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="4cc78bf24c6cfb4580ae48b13e1f26b6b00869c612b5d662632f7561f7475252";
uname_s_glob="linux"; uname_m_glob="armv7l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="80f5ebc8efe62a0c322e92d15d469e80f9d3ce967c5d5118138674c47f96747b";
uname_s_glob="linux"; uname_m_glob="armv8l"; file="gitstatusd-${uname_s}-aarch64"; version="v1.3.1"; sha256="4e0a506eafb14b009cf6670f0e11399ac7e765cad17b9fcf38ef65516d248bfa";
uname_s_glob="linux"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="ba506fbecf4a4430533e661bb63c7b77f6b4836ea013bdf8a6eabeace456f3b9";
uname_s_glob="linux"; uname_m_glob="ppc64le"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="1bf907db28ac7d6516add51be47b73b1854b84ecf46de56ccb1479e6a7e29ed2";
uname_s_glob="linux"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.0"; sha256="d88e33e6174b205d76eaa6f6a88129d5854f9f52348983807dede2e81caae844";
uname_s_glob="msys_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="618d2425c6a22fa3762fe6fe252f9ddb4ed9138df1377e48b2f119cd4875f400";
uname_s_glob="msys_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.3.1"; sha256="bdfae7a7c0fd83d0214a7eabde3b7d8709336bd08697a74d48bea4a04c352676";
uname_s_glob="cygwin_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="fe132c412c460c2889d731012d280207fe2b4a3c94d077fb4f1c06ed5d319a42";
uname_s_glob="cygwin_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="c84cade0d6b86e04c27a6055f45851f6b46d6b88ba58772f7ca8ef4d295c800f";
uname_s_glob="darwin"; uname_m_glob="arm64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="ad973948cca4bdcf83b7fcdda70c489a404488ea7304712721f1100b73ec7cbe";
uname_s_glob="darwin"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="b13455d56cf7b6f07efb7da088057bbc1212847c88b59493918d6f9c0c157160";
uname_s_glob="freebsd"; uname_m_glob="amd64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="b738c0967ba7a851bd758cd9fd836cddeec9fb4246afddc66ab4fed40c03e426";
uname_s_glob="linux"; uname_m_glob="aarch64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="89b87181b2005527a558cdbc32b12b0f15a1a12bb69865ec216ca5a0266a6c4f";
uname_s_glob="linux"; uname_m_glob="armv6l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="4bf5a0d0a082f544a48536ad3675930d5d2cc6a8cf906710045e0788f51192b3";
uname_s_glob="linux"; uname_m_glob="armv7l"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="2b9deb29f86c8209114b71b94fc2e1ed936a1658808a1bee46f4a82fd6a1f8cc";
uname_s_glob="linux"; uname_m_glob="armv8l"; file="gitstatusd-${uname_s}-aarch64"; version="v1.5.1"; sha256="89b87181b2005527a558cdbc32b12b0f15a1a12bb69865ec216ca5a0266a6c4f";
uname_s_glob="linux"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="4998bf7889f625df71f1da5757915b678e04039cc8cba00ae10950352c7329f9";
uname_s_glob="linux"; uname_m_glob="ppc64le"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="e5336dc8e23406c649bafeea83ff17df1726b05ee490f67bae549e55a9a7a7c4";
uname_s_glob="linux"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="0e8bbc46c17f5cd6e0db98b74c48f4b68f464f98550c8254f6cfcfd936ad1fcf";
uname_s_glob="msys_nt-10.0"; uname_m_glob="i686"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="7f9b849fc52e7a95b9b933e25121ad5ae990a1871aad6616922ad7bcf1eebf20";
uname_s_glob="msys_nt-10.0"; uname_m_glob="x86_64"; file="gitstatusd-${uname_s}-${uname_m}"; version="v1.5.1"; sha256="5d3c626b5ee564dbc13ddba89752dc58b0efe925b26dbd8b2304849d9ba01732";
# Fallbacks to official gitstatusd binaries.
uname_s_glob="cygwin_nt-*"; uname_m_glob="i686"; file="gitstatusd-cygwin_nt-10.0-${uname_m}"; version="v1.3.1"; sha256="c96baef70b81b5a1d46adcc9e93721eaf4bdc295562bdd2baf210a6b416b9911";
uname_s_glob="cygwin_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-cygwin_nt-10.0-${uname_m}"; version="v1.3.1"; sha256="18b5be49f6eb9ff1cf25e76d6f2333c7402e686e05ce5b88ca107c80504210d8";
uname_s_glob="mingw32_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.3.1"; sha256="618d2425c6a22fa3762fe6fe252f9ddb4ed9138df1377e48b2f119cd4875f400";
uname_s_glob="mingw32_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.3.1"; sha256="bdfae7a7c0fd83d0214a7eabde3b7d8709336bd08697a74d48bea4a04c352676";
uname_s_glob="mingw64_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.3.1"; sha256="618d2425c6a22fa3762fe6fe252f9ddb4ed9138df1377e48b2f119cd4875f400";
uname_s_glob="mingw64_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.3.1"; sha256="bdfae7a7c0fd83d0214a7eabde3b7d8709336bd08697a74d48bea4a04c352676";
uname_s_glob="msys_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.3.1"; sha256="618d2425c6a22fa3762fe6fe252f9ddb4ed9138df1377e48b2f119cd4875f400";
uname_s_glob="msys_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.3.1"; sha256="bdfae7a7c0fd83d0214a7eabde3b7d8709336bd08697a74d48bea4a04c352676";
uname_s_glob="cygwin_nt-*"; uname_m_glob="i686"; file="gitstatusd-cygwin_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="fe132c412c460c2889d731012d280207fe2b4a3c94d077fb4f1c06ed5d319a42";
uname_s_glob="cygwin_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-cygwin_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="c84cade0d6b86e04c27a6055f45851f6b46d6b88ba58772f7ca8ef4d295c800f";
uname_s_glob="mingw32_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="7f9b849fc52e7a95b9b933e25121ad5ae990a1871aad6616922ad7bcf1eebf20";
uname_s_glob="mingw32_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="5d3c626b5ee564dbc13ddba89752dc58b0efe925b26dbd8b2304849d9ba01732";
uname_s_glob="mingw64_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="7f9b849fc52e7a95b9b933e25121ad5ae990a1871aad6616922ad7bcf1eebf20";
uname_s_glob="mingw64_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="5d3c626b5ee564dbc13ddba89752dc58b0efe925b26dbd8b2304849d9ba01732";
uname_s_glob="msys_nt-*"; uname_m_glob="i686"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="7f9b849fc52e7a95b9b933e25121ad5ae990a1871aad6616922ad7bcf1eebf20";
uname_s_glob="msys_nt-*"; uname_m_glob="x86_64"; file="gitstatusd-msys_nt-10.0-${uname_m}"; version="v1.5.1"; sha256="5d3c626b5ee564dbc13ddba89752dc58b0efe925b26dbd8b2304849d9ba01732";

7
mbuild
View file

@ -212,10 +212,11 @@ function build-windows() {
tmp='/cygdrive/c/tmp'
;|
msys_nt-10.0-*)
flags+=(-s)
tmp='/c/tmp'
env='MSYSTEM=MSYS'
intro='pacman -Syu --noconfirm; pacman -S --needed --noconfirm git; '
# TODO: fix this (some errors about PGP keys).
# flags+=(-s)
# intro='pacman -S --needed --noconfirm git; '
intro+='PATH="$PATH:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl"'
while true; do
# TODO: run autorebase only when getting an error that can be fixed by autorebasing.
@ -230,6 +231,8 @@ function build-windows() {
done
() {
while true; do
# TODO: fix this (some errors about PGP keys).
break
local -i fd
exec {fd}< <(
ssh $1 $c/$bin/env.exe $env c:/$bin/bash.exe -l 2>&1 <<<"

View file

@ -54,7 +54,7 @@ long ParseInt(const char* s) {
}
size_t ParseSizeT(const char* s) {
static_assert(sizeof(long) <= sizeof(size_t));
static_assert(sizeof(long) <= sizeof(size_t), "");
long res = ParseLong(s);
return res >= 0 ? res : -1;
}

View file

@ -212,13 +212,29 @@ void TagDb::ParsePack() {
char* p = &pack_[0];
char* e = p + pack_.size();
if (*p == '#') {
// Usually packed-refs starts with the following line:
//
// # pack-refs with: peeled fully-peeled sorted
//
// However, some users can produce pack-refs without this line.
// See https://github.com/romkatv/powerlevel10k/issues/1428.
// I don't know how they do it. Without the header line we cannot
// assume that refs are sorted, which isn't a big deal because we
// can just sort them. What's worse is that refs cannot be assumed
// to be fully-peeled. We don't want to peel them, so we just drop
// all tags.
if (*p != '#') {
LOG(WARN) << "packed-refs doesn't have a header. Won't resolve tags.";
return;
}
char* eol = std::strchr(p, '\n');
if (!eol) return;
*eol = 0;
if (!std::strstr(p, " fully-peeled") || !std::strstr(p, " sorted")) return;
p = eol + 1;
if (!std::strstr(p, " fully-peeled") || !std::strstr(p, " sorted")) {
LOG(WARN) << "packed-refs has unexpected header. Won't resolve tags.";
}
p = eol + 1;
name2id_.reserve(pack_.size() / 128);
id2name_.reserve(pack_.size() / 128);
@ -249,7 +265,10 @@ void TagDb::ParsePack() {
id2name_.push_back(tag);
}
VERIFY(std::is_sorted(name2id_.begin(), name2id_.end(), ByName));
if (!std::is_sorted(name2id_.begin(), name2id_.end(), ByName)) {
// "sorted" in the header of packed-refs promisses that this won't trigger.
std::sort(name2id_.begin(), name2id_.end(), ByName);
}
id2name_dirty_ = true;
GlobalThreadPool()->Schedule([this] {