This commit is contained in:
Vladimir Dubovik
2025-06-23 15:08:29 +03:00
parent 8d8860ff22
commit d2c165d049
166 changed files with 1067 additions and 9938 deletions

View File

@ -0,0 +1,80 @@
af5d288a9cecbef16046d0d4b9146d9a09b9d5ee not-for-merge branch '4.2.0' of https://github.com/instacart/TrueTime.swift
07598687ff6e9a8c7bcdb24aa5e4fc8f5db3ed5b not-for-merge branch '5.0.1' of https://github.com/instacart/TrueTime.swift
7d21bdd89d5274c364d028ce1d1bfd619da06c00 not-for-merge branch '5.0.2' of https://github.com/instacart/TrueTime.swift
fce48c177cbd0db8d99a89dc6a596b7d417a9fd9 not-for-merge branch '5.0.3' of https://github.com/instacart/TrueTime.swift
9b874ce4c7c8f0240064972a1f0ffbf96fc0c859 not-for-merge branch 'flobories/no_force_unwrap' of https://github.com/instacart/TrueTime.swift
14c2d65554d687c228b0097a2bcf4e15de5f697f not-for-merge branch 'master' of https://github.com/instacart/TrueTime.swift
dd57deda8535ab08e911af6dde328af1d6d3242e not-for-merge branch 'mp/remove_result' of https://github.com/instacart/TrueTime.swift
6638e21bbec93446890b40c0212e77634c862524 not-for-merge branch 'ms/develop' of https://github.com/instacart/TrueTime.swift
5374b644d8f52af01fb95e531ef9db1a2b53af89 not-for-merge branch 'ms/fix-leaks' of https://github.com/instacart/TrueTime.swift
f4c6adf59e3fb697901b3de67b72ba19d0ef251c not-for-merge branch 'ms/update-podspec' of https://github.com/instacart/TrueTime.swift
b2c5b40e05d4971c6f29f8032ee11dd86d961828 not-for-merge branch 'satish/xcode_deployment_target_update' of https://github.com/instacart/TrueTime.swift
e64608a8b2bf6fdba4c2c69fce3fd7fccba83eb2 not-for-merge 'refs/pull/1/head' of https://github.com/instacart/TrueTime.swift
2bb5c4c36eb695cf9a0d4105f5ed0b2e4213ca1a not-for-merge 'refs/pull/10/head' of https://github.com/instacart/TrueTime.swift
31ab562a98b20892e507f0eaf39a7c8ab5178613 not-for-merge 'refs/pull/105/head' of https://github.com/instacart/TrueTime.swift
882fd3aaffb10a7599df47bc48ddbc1a4cb8e1d5 not-for-merge 'refs/pull/105/merge' of https://github.com/instacart/TrueTime.swift
10460729d8c5634fb6b81c230e865a20b9d8197b not-for-merge 'refs/pull/107/head' of https://github.com/instacart/TrueTime.swift
c84fac183aced0a9ab8595ddde236620530375df not-for-merge 'refs/pull/107/merge' of https://github.com/instacart/TrueTime.swift
8e88e648f37c16720247c3f6c6f3752778a4214c not-for-merge 'refs/pull/111/head' of https://github.com/instacart/TrueTime.swift
40e2a3bcb7020533ccd997537644fb01ea6d35e9 not-for-merge 'refs/pull/111/merge' of https://github.com/instacart/TrueTime.swift
0b674d606472f58ce0789e2140af0544400685d6 not-for-merge 'refs/pull/115/head' of https://github.com/instacart/TrueTime.swift
19a80c2fca7516fe2dc614e5a4b5b65525c5e943 not-for-merge 'refs/pull/116/head' of https://github.com/instacart/TrueTime.swift
4637770e9c6d76af2fc4c16c43388e9a65104745 not-for-merge 'refs/pull/116/merge' of https://github.com/instacart/TrueTime.swift
70f2f498675817a13c2526932cb4736c45d98bd7 not-for-merge 'refs/pull/117/head' of https://github.com/instacart/TrueTime.swift
dcf5479b9f2b426bd660ccdc2f34342b2fedf553 not-for-merge 'refs/pull/117/merge' of https://github.com/instacart/TrueTime.swift
13fe425ffbf413c627ff8e7077a7f7ad7a6fd3c1 not-for-merge 'refs/pull/13/head' of https://github.com/instacart/TrueTime.swift
3b8f92f722bd73cb8d2296e3ea23602d70310c19 not-for-merge 'refs/pull/2/head' of https://github.com/instacart/TrueTime.swift
c0edece1f2ed5c39a075be6d8fb1e8791377caf9 not-for-merge 'refs/pull/20/head' of https://github.com/instacart/TrueTime.swift
636cfc24d145d5d6fb201f48578c360ae653b93b not-for-merge 'refs/pull/20/merge' of https://github.com/instacart/TrueTime.swift
045dc3f54b0e02e65d063d97340f87b5ddca3a6b not-for-merge 'refs/pull/21/head' of https://github.com/instacart/TrueTime.swift
3f69d511274afbb610ada90e40af167b45eb0b33 not-for-merge 'refs/pull/22/head' of https://github.com/instacart/TrueTime.swift
0f428e7d24a01be2f6df1cfce22809776ef1d2c9 not-for-merge 'refs/pull/25/head' of https://github.com/instacart/TrueTime.swift
8363df3d7e78e7fd1aff8e25e911572ae4daf12b not-for-merge 'refs/pull/26/head' of https://github.com/instacart/TrueTime.swift
ca0447c6807ef0acab087f98b2b209159b17c02d not-for-merge 'refs/pull/27/head' of https://github.com/instacart/TrueTime.swift
aeea123478e8d72a792be0a350fb318185f9eb3b not-for-merge 'refs/pull/28/head' of https://github.com/instacart/TrueTime.swift
870ecbb3044298eb17f6b1c9faf2ff4053b2ffc7 not-for-merge 'refs/pull/3/head' of https://github.com/instacart/TrueTime.swift
645e17eaad30e014ec5fed42cc8359d32221328b not-for-merge 'refs/pull/35/head' of https://github.com/instacart/TrueTime.swift
286a5080854aa42a6eae9dd3e060ca845921851d not-for-merge 'refs/pull/4/head' of https://github.com/instacart/TrueTime.swift
92241af2728b36ef734a23e986f440b900a8efb8 not-for-merge 'refs/pull/41/head' of https://github.com/instacart/TrueTime.swift
4f7a418117473b91a01ceac4cb9aeb683734931f not-for-merge 'refs/pull/43/head' of https://github.com/instacart/TrueTime.swift
06802f9b7fb08d5244dd3b2db17b72b68be81c38 not-for-merge 'refs/pull/43/merge' of https://github.com/instacart/TrueTime.swift
78c265d4b1755f645e71d8877dfc2d517e61596c not-for-merge 'refs/pull/49/head' of https://github.com/instacart/TrueTime.swift
b4d1f43c9418460732a42aec3ed63cab4b091f0d not-for-merge 'refs/pull/6/head' of https://github.com/instacart/TrueTime.swift
eec339c6ed04de4ac812cebc0d3aa94596259694 not-for-merge 'refs/pull/60/head' of https://github.com/instacart/TrueTime.swift
54e3924496eb85093063f2dbbc53761a8f4310a2 not-for-merge 'refs/pull/63/head' of https://github.com/instacart/TrueTime.swift
b71549c9aaf82be30733649cf6088b612cb40e20 not-for-merge 'refs/pull/65/head' of https://github.com/instacart/TrueTime.swift
52bd9936e392b1e3e6b7eb8a0feb100802f066bb not-for-merge 'refs/pull/67/head' of https://github.com/instacart/TrueTime.swift
0c6ea7168a63b32f0fb329a989d72403bc813203 not-for-merge 'refs/pull/68/head' of https://github.com/instacart/TrueTime.swift
edf4ff7df44f2fd29cbde359cfe0125d4200cdb2 not-for-merge 'refs/pull/7/head' of https://github.com/instacart/TrueTime.swift
b8e47dcfc65582078500b3598fe56cd4fa75bb57 not-for-merge 'refs/pull/71/head' of https://github.com/instacart/TrueTime.swift
8582bbc27ed2b70aac34fae4a00ccf68a420b74c not-for-merge 'refs/pull/72/head' of https://github.com/instacart/TrueTime.swift
dd57deda8535ab08e911af6dde328af1d6d3242e not-for-merge 'refs/pull/73/head' of https://github.com/instacart/TrueTime.swift
457580c83e120ff452356b4c53be8ac08f2bb3ab not-for-merge 'refs/pull/74/head' of https://github.com/instacart/TrueTime.swift
bb4f6922746fc9824362a7ded915b7c6c15aadc9 not-for-merge 'refs/pull/75/head' of https://github.com/instacart/TrueTime.swift
fce48c177cbd0db8d99a89dc6a596b7d417a9fd9 not-for-merge 'refs/pull/76/head' of https://github.com/instacart/TrueTime.swift
6be9ff167abd1a451de939afc224beef7d52974c not-for-merge 'refs/pull/8/head' of https://github.com/instacart/TrueTime.swift
3a04acd927b4c10efa48d6becd7d38a04a1e02ea not-for-merge 'refs/pull/86/head' of https://github.com/instacart/TrueTime.swift
7d6b475ad79d9f488c75e76dde00e030dee5c12c not-for-merge 'refs/pull/92/head' of https://github.com/instacart/TrueTime.swift
83ddab03e0d31cdbd5f6ce462d832c652eb2f798 not-for-merge 'refs/pull/92/merge' of https://github.com/instacart/TrueTime.swift
753434982cf09cb17372f6ff5ff339a030a71063 not-for-merge tag '1.0.0' of https://github.com/instacart/TrueTime.swift
39960a646d52d0df7868fdbb41affc2bac3fe722 not-for-merge tag '1.0.1' of https://github.com/instacart/TrueTime.swift
7b9e18c35ff3d059e154782fd890895eec605086 not-for-merge tag '1.1.0' of https://github.com/instacart/TrueTime.swift
8c7c63b556f58e6b0dbe79531234285e06219ec3 not-for-merge tag '2.0.0' of https://github.com/instacart/TrueTime.swift
730dd1d5f86bbc177e7dfe2edaef6531d729fb02 not-for-merge tag '2.1.0' of https://github.com/instacart/TrueTime.swift
b40a9aa4db48e2a7e275527bb749732f084d1cab not-for-merge tag '2.1.1' of https://github.com/instacart/TrueTime.swift
4f3f8c8eec918716e790af603565405716c1de10 not-for-merge tag '3.0.0' of https://github.com/instacart/TrueTime.swift
a7434ded7df4d9553eafcb3a777c7738e77857ce not-for-merge tag '3.1.0' of https://github.com/instacart/TrueTime.swift
18d981ca6e5d8555118368964bdf53fc58813205 not-for-merge tag '3.1.1' of https://github.com/instacart/TrueTime.swift
85bc4e867153d0bcdb72fa84e7da5d6fbb58b29b not-for-merge tag '4.0.0' of https://github.com/instacart/TrueTime.swift
bbfa2defd6b0c0f5f4727ce476d7c1786ec5ce34 not-for-merge tag '4.1.0' of https://github.com/instacart/TrueTime.swift
bac1265d4cc1fc6c9e08d0dce7ad7fce63f5eedc not-for-merge tag '4.1.1' of https://github.com/instacart/TrueTime.swift
42fe9355f3e6c2e0bce372d1b12fc33ec0f62c0a not-for-merge tag '4.1.2' of https://github.com/instacart/TrueTime.swift
37ef69eae4159f58e3aaf0f03dc02b8cfcff61d3 not-for-merge tag '4.1.3' of https://github.com/instacart/TrueTime.swift
73a2fedae46d469703f8452265cdb093f1a60b20 not-for-merge tag '4.1.4' of https://github.com/instacart/TrueTime.swift
0a98d0086b2891fbf88ba0675ec3119fb62798fb not-for-merge tag '4.1.5' of https://github.com/instacart/TrueTime.swift
fa538b1a7a8e07c5270316487851e653e63c701a not-for-merge tag '4.2.0' of https://github.com/instacart/TrueTime.swift
03b9db0c4d19939d716afc1f86cddceeb92aec80 not-for-merge tag '5.0.0' of https://github.com/instacart/TrueTime.swift
ea1b6192f1c3416760ca1b6a4ab446c0edd1d798 not-for-merge tag '5.0.1' of https://github.com/instacart/TrueTime.swift
c737861ae5cbd0f16342db170e30bc61b583e8f3 not-for-merge tag '5.0.2' of https://github.com/instacart/TrueTime.swift
8b6f114d92c4a732850158403484ffddab3c4192 not-for-merge tag '5.0.3' of https://github.com/instacart/TrueTime.swift
14c2d65554d687c228b0097a2bcf4e15de5f697f not-for-merge tag '5.1.0' of https://github.com/instacart/TrueTime.swift

View File

@ -0,0 +1 @@
ref: refs/heads/master

View File

@ -0,0 +1,10 @@
[core]
repositoryformatversion = 0
filemode = true
bare = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = https://github.com/instacart/TrueTime.swift.git
fetch = +refs/*:refs/*
mirror = true

View File

@ -0,0 +1 @@
Unnamed repository; edit this file 'description' to name the repository.

View File

@ -0,0 +1,15 @@
#!/bin/sh
#
# An example hook script to check the commit log message taken by
# applypatch from an e-mail message.
#
# The hook should exit with non-zero status after issuing an
# appropriate message if it wants to stop the commit. The hook is
# allowed to edit the commit message file.
#
# To enable this hook, rename this file to "applypatch-msg".
. git-sh-setup
commitmsg="$(git rev-parse --git-path hooks/commit-msg)"
test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"}
:

View File

@ -0,0 +1,24 @@
#!/bin/sh
#
# An example hook script to check the commit log message.
# Called by "git commit" with one argument, the name of the file
# that has the commit message. The hook should exit with non-zero
# status after issuing an appropriate message if it wants to stop the
# commit. The hook is allowed to edit the commit message file.
#
# To enable this hook, rename this file to "commit-msg".
# Uncomment the below to add a Signed-off-by line to the message.
# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
# hook is more suited to it.
#
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
# This example catches duplicate Signed-off-by lines.
test "" = "$(grep '^Signed-off-by: ' "$1" |
sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
echo >&2 Duplicate Signed-off-by lines.
exit 1
}

View File

@ -0,0 +1,174 @@
#!/usr/bin/perl
use strict;
use warnings;
use IPC::Open2;
# An example hook script to integrate Watchman
# (https://facebook.github.io/watchman/) with git to speed up detecting
# new and modified files.
#
# The hook is passed a version (currently 2) and last update token
# formatted as a string and outputs to stdout a new update token and
# all files that have been modified since the update token. Paths must
# be relative to the root of the working tree and separated by a single NUL.
#
# To enable this hook, rename this file to "query-watchman" and set
# 'git config core.fsmonitor .git/hooks/query-watchman'
#
my ($version, $last_update_token) = @ARGV;
# Uncomment for debugging
# print STDERR "$0 $version $last_update_token\n";
# Check the hook interface version
if ($version ne 2) {
die "Unsupported query-fsmonitor hook version '$version'.\n" .
"Falling back to scanning...\n";
}
my $git_work_tree = get_working_dir();
my $retry = 1;
my $json_pkg;
eval {
require JSON::XS;
$json_pkg = "JSON::XS";
1;
} or do {
require JSON::PP;
$json_pkg = "JSON::PP";
};
launch_watchman();
sub launch_watchman {
my $o = watchman_query();
if (is_work_tree_watched($o)) {
output_result($o->{clock}, @{$o->{files}});
}
}
sub output_result {
my ($clockid, @files) = @_;
# Uncomment for debugging watchman output
# open (my $fh, ">", ".git/watchman-output.out");
# binmode $fh, ":utf8";
# print $fh "$clockid\n@files\n";
# close $fh;
binmode STDOUT, ":utf8";
print $clockid;
print "\0";
local $, = "\0";
print @files;
}
sub watchman_clock {
my $response = qx/watchman clock "$git_work_tree"/;
die "Failed to get clock id on '$git_work_tree'.\n" .
"Falling back to scanning...\n" if $? != 0;
return $json_pkg->new->utf8->decode($response);
}
sub watchman_query {
my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty')
or die "open2() failed: $!\n" .
"Falling back to scanning...\n";
# In the query expression below we're asking for names of files that
# changed since $last_update_token but not from the .git folder.
#
# To accomplish this, we're using the "since" generator to use the
# recency index to select candidate nodes and "fields" to limit the
# output to file names only. Then we're using the "expression" term to
# further constrain the results.
my $last_update_line = "";
if (substr($last_update_token, 0, 1) eq "c") {
$last_update_token = "\"$last_update_token\"";
$last_update_line = qq[\n"since": $last_update_token,];
}
my $query = <<" END";
["query", "$git_work_tree", {$last_update_line
"fields": ["name"],
"expression": ["not", ["dirname", ".git"]]
}]
END
# Uncomment for debugging the watchman query
# open (my $fh, ">", ".git/watchman-query.json");
# print $fh $query;
# close $fh;
print CHLD_IN $query;
close CHLD_IN;
my $response = do {local $/; <CHLD_OUT>};
# Uncomment for debugging the watch response
# open ($fh, ">", ".git/watchman-response.json");
# print $fh $response;
# close $fh;
die "Watchman: command returned no output.\n" .
"Falling back to scanning...\n" if $response eq "";
die "Watchman: command returned invalid output: $response\n" .
"Falling back to scanning...\n" unless $response =~ /^\{/;
return $json_pkg->new->utf8->decode($response);
}
sub is_work_tree_watched {
my ($output) = @_;
my $error = $output->{error};
if ($retry > 0 and $error and $error =~ m/unable to resolve root .* directory (.*) is not watched/) {
$retry--;
my $response = qx/watchman watch "$git_work_tree"/;
die "Failed to make watchman watch '$git_work_tree'.\n" .
"Falling back to scanning...\n" if $? != 0;
$output = $json_pkg->new->utf8->decode($response);
$error = $output->{error};
die "Watchman: $error.\n" .
"Falling back to scanning...\n" if $error;
# Uncomment for debugging watchman output
# open (my $fh, ">", ".git/watchman-output.out");
# close $fh;
# Watchman will always return all files on the first query so
# return the fast "everything is dirty" flag to git and do the
# Watchman query just to get it over with now so we won't pay
# the cost in git to look up each individual file.
my $o = watchman_clock();
$error = $output->{error};
die "Watchman: $error.\n" .
"Falling back to scanning...\n" if $error;
output_result($o->{clock}, ("/"));
$last_update_token = $o->{clock};
eval { launch_watchman() };
return 0;
}
die "Watchman: $error.\n" .
"Falling back to scanning...\n" if $error;
return 1;
}
sub get_working_dir {
my $working_dir;
if ($^O =~ 'msys' || $^O =~ 'cygwin') {
$working_dir = Win32::GetCwd();
$working_dir =~ tr/\\/\//;
} else {
require Cwd;
$working_dir = Cwd::cwd();
}
return $working_dir;
}

View File

@ -0,0 +1,8 @@
#!/bin/sh
#
# An example hook script to prepare a packed repository for use over
# dumb transports.
#
# To enable this hook, rename this file to "post-update".
exec git update-server-info

View File

@ -0,0 +1,14 @@
#!/bin/sh
#
# An example hook script to verify what is about to be committed
# by applypatch from an e-mail message.
#
# The hook should exit with non-zero status after issuing an
# appropriate message if it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-applypatch".
. git-sh-setup
precommit="$(git rev-parse --git-path hooks/pre-commit)"
test -x "$precommit" && exec "$precommit" ${1+"$@"}
:

View File

@ -0,0 +1,49 @@
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=$(git hash-object -t tree /dev/null)
fi
# If you want to allow non-ASCII filenames set this variable to true.
allownonascii=$(git config --type=bool hooks.allownonascii)
# Redirect output to stderr.
exec 1>&2
# Cross platform projects tend to avoid non-ASCII filenames; prevent
# them from being added to the repository. We exploit the fact that the
# printable range starts at the space character and ends with tilde.
if [ "$allownonascii" != "true" ] &&
# Note that the use of brackets around a tr range is ok here, (it's
# even required, for portability to Solaris 10's /usr/bin/tr), since
# the square bracket bytes happen to fall in the designated range.
test $(git diff --cached --name-only --diff-filter=A -z $against |
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
then
cat <<\EOF
Error: Attempt to add a non-ASCII file name.
This can cause problems if you want to work with people on other platforms.
To be portable it is advisable to rename the file.
If you know what you are doing you can disable this check using:
git config hooks.allownonascii true
EOF
exit 1
fi
# If there are whitespace errors, print the offending file names and fail.
exec git diff-index --check --cached $against --

View File

@ -0,0 +1,13 @@
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git merge" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message to
# stderr if it wants to stop the merge commit.
#
# To enable this hook, rename this file to "pre-merge-commit".
. git-sh-setup
test -x "$GIT_DIR/hooks/pre-commit" &&
exec "$GIT_DIR/hooks/pre-commit"
:

View File

@ -0,0 +1,53 @@
#!/bin/sh
# An example hook script to verify what is about to be pushed. Called by "git
# push" after it has checked the remote status, but before anything has been
# pushed. If this script exits with a non-zero status nothing will be pushed.
#
# This hook is called with the following parameters:
#
# $1 -- Name of the remote to which the push is being done
# $2 -- URL to which the push is being done
#
# If pushing without using a named remote those arguments will be equal.
#
# Information about the commits which are being pushed is supplied as lines to
# the standard input in the form:
#
# <local ref> <local oid> <remote ref> <remote oid>
#
# This sample shows how to prevent push of commits where the log message starts
# with "WIP" (work in progress).
remote="$1"
url="$2"
zero=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')
while read local_ref local_oid remote_ref remote_oid
do
if test "$local_oid" = "$zero"
then
# Handle delete
:
else
if test "$remote_oid" = "$zero"
then
# New branch, examine all commits
range="$local_oid"
else
# Update to existing branch, examine new commits
range="$remote_oid..$local_oid"
fi
# Check for WIP commit
commit=$(git rev-list -n 1 --grep '^WIP' "$range")
if test -n "$commit"
then
echo >&2 "Found WIP commit in $local_ref, not pushing"
exit 1
fi
fi
done
exit 0

View File

@ -0,0 +1,169 @@
#!/bin/sh
#
# Copyright (c) 2006, 2008 Junio C Hamano
#
# The "pre-rebase" hook is run just before "git rebase" starts doing
# its job, and can prevent the command from running by exiting with
# non-zero status.
#
# The hook is called with the following parameters:
#
# $1 -- the upstream the series was forked from.
# $2 -- the branch being rebased (or empty when rebasing the current branch).
#
# This sample shows how to prevent topic branches that are already
# merged to 'next' branch from getting rebased, because allowing it
# would result in rebasing already published history.
publish=next
basebranch="$1"
if test "$#" = 2
then
topic="refs/heads/$2"
else
topic=`git symbolic-ref HEAD` ||
exit 0 ;# we do not interrupt rebasing detached HEAD
fi
case "$topic" in
refs/heads/??/*)
;;
*)
exit 0 ;# we do not interrupt others.
;;
esac
# Now we are dealing with a topic branch being rebased
# on top of master. Is it OK to rebase it?
# Does the topic really exist?
git show-ref -q "$topic" || {
echo >&2 "No such branch $topic"
exit 1
}
# Is topic fully merged to master?
not_in_master=`git rev-list --pretty=oneline ^master "$topic"`
if test -z "$not_in_master"
then
echo >&2 "$topic is fully merged to master; better remove it."
exit 1 ;# we could allow it, but there is no point.
fi
# Is topic ever merged to next? If so you should not be rebasing it.
only_next_1=`git rev-list ^master "^$topic" ${publish} | sort`
only_next_2=`git rev-list ^master ${publish} | sort`
if test "$only_next_1" = "$only_next_2"
then
not_in_topic=`git rev-list "^$topic" master`
if test -z "$not_in_topic"
then
echo >&2 "$topic is already up to date with master"
exit 1 ;# we could allow it, but there is no point.
else
exit 0
fi
else
not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"`
/usr/bin/perl -e '
my $topic = $ARGV[0];
my $msg = "* $topic has commits already merged to public branch:\n";
my (%not_in_next) = map {
/^([0-9a-f]+) /;
($1 => 1);
} split(/\n/, $ARGV[1]);
for my $elem (map {
/^([0-9a-f]+) (.*)$/;
[$1 => $2];
} split(/\n/, $ARGV[2])) {
if (!exists $not_in_next{$elem->[0]}) {
if ($msg) {
print STDERR $msg;
undef $msg;
}
print STDERR " $elem->[1]\n";
}
}
' "$topic" "$not_in_next" "$not_in_master"
exit 1
fi
<<\DOC_END
This sample hook safeguards topic branches that have been
published from being rewound.
The workflow assumed here is:
* Once a topic branch forks from "master", "master" is never
merged into it again (either directly or indirectly).
* Once a topic branch is fully cooked and merged into "master",
it is deleted. If you need to build on top of it to correct
earlier mistakes, a new topic branch is created by forking at
the tip of the "master". This is not strictly necessary, but
it makes it easier to keep your history simple.
* Whenever you need to test or publish your changes to topic
branches, merge them into "next" branch.
The script, being an example, hardcodes the publish branch name
to be "next", but it is trivial to make it configurable via
$GIT_DIR/config mechanism.
With this workflow, you would want to know:
(1) ... if a topic branch has ever been merged to "next". Young
topic branches can have stupid mistakes you would rather
clean up before publishing, and things that have not been
merged into other branches can be easily rebased without
affecting other people. But once it is published, you would
not want to rewind it.
(2) ... if a topic branch has been fully merged to "master".
Then you can delete it. More importantly, you should not
build on top of it -- other people may already want to
change things related to the topic as patches against your
"master", so if you need further changes, it is better to
fork the topic (perhaps with the same name) afresh from the
tip of "master".
Let's look at this example:
o---o---o---o---o---o---o---o---o---o "next"
/ / / /
/ a---a---b A / /
/ / / /
/ / c---c---c---c B /
/ / / \ /
/ / / b---b C \ /
/ / / / \ /
---o---o---o---o---o---o---o---o---o---o---o "master"
A, B and C are topic branches.
* A has one fix since it was merged up to "next".
* B has finished. It has been fully merged up to "master" and "next",
and is ready to be deleted.
* C has not merged to "next" at all.
We would want to allow C to be rebased, refuse A, and encourage
B to be deleted.
To compute (1):
git rev-list ^master ^topic next
git rev-list ^master next
if these match, topic has not merged in next at all.
To compute (2):
git rev-list master..topic
if this is empty, it is fully merged to "master".
DOC_END

View File

@ -0,0 +1,24 @@
#!/bin/sh
#
# An example hook script to make use of push options.
# The example simply echoes all push options that start with 'echoback='
# and rejects all pushes when the "reject" push option is used.
#
# To enable this hook, rename this file to "pre-receive".
if test -n "$GIT_PUSH_OPTION_COUNT"
then
i=0
while test "$i" -lt "$GIT_PUSH_OPTION_COUNT"
do
eval "value=\$GIT_PUSH_OPTION_$i"
case "$value" in
echoback=*)
echo "echo from the pre-receive-hook: ${value#*=}" >&2
;;
reject)
exit 1
esac
i=$((i + 1))
done
fi

View File

@ -0,0 +1,42 @@
#!/bin/sh
#
# An example hook script to prepare the commit log message.
# Called by "git commit" with the name of the file that has the
# commit message, followed by the description of the commit
# message's source. The hook's purpose is to edit the commit
# message file. If the hook fails with a non-zero status,
# the commit is aborted.
#
# To enable this hook, rename this file to "prepare-commit-msg".
# This hook includes three examples. The first one removes the
# "# Please enter the commit message..." help message.
#
# The second includes the output of "git diff --name-status -r"
# into the message, just before the "git status" output. It is
# commented because it doesn't cope with --amend or with squashed
# commits.
#
# The third example adds a Signed-off-by line to the message, that can
# still be edited. This is rarely a good idea.
COMMIT_MSG_FILE=$1
COMMIT_SOURCE=$2
SHA1=$3
/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE"
# case "$COMMIT_SOURCE,$SHA1" in
# ,|template,)
# /usr/bin/perl -i.bak -pe '
# print "\n" . `git diff --cached --name-status -r`
# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;;
# *) ;;
# esac
# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE"
# if test -z "$COMMIT_SOURCE"
# then
# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE"
# fi

View File

@ -0,0 +1,78 @@
#!/bin/sh
# An example hook script to update a checked-out tree on a git push.
#
# This hook is invoked by git-receive-pack(1) when it reacts to git
# push and updates reference(s) in its repository, and when the push
# tries to update the branch that is currently checked out and the
# receive.denyCurrentBranch configuration variable is set to
# updateInstead.
#
# By default, such a push is refused if the working tree and the index
# of the remote repository has any difference from the currently
# checked out commit; when both the working tree and the index match
# the current commit, they are updated to match the newly pushed tip
# of the branch. This hook is to be used to override the default
# behaviour; however the code below reimplements the default behaviour
# as a starting point for convenient modification.
#
# The hook receives the commit with which the tip of the current
# branch is going to be updated:
commit=$1
# It can exit with a non-zero status to refuse the push (when it does
# so, it must not modify the index or the working tree).
die () {
echo >&2 "$*"
exit 1
}
# Or it can make any necessary changes to the working tree and to the
# index to bring them to the desired state when the tip of the current
# branch is updated to the new commit, and exit with a zero status.
#
# For example, the hook can simply run git read-tree -u -m HEAD "$1"
# in order to emulate git fetch that is run in the reverse direction
# with git push, as the two-tree form of git read-tree -u -m is
# essentially the same as git switch or git checkout that switches
# branches while keeping the local changes in the working tree that do
# not interfere with the difference between the branches.
# The below is a more-or-less exact translation to shell of the C code
# for the default behaviour for git's push-to-checkout hook defined in
# the push_to_deploy() function in builtin/receive-pack.c.
#
# Note that the hook will be executed from the repository directory,
# not from the working tree, so if you want to perform operations on
# the working tree, you will have to adapt your code accordingly, e.g.
# by adding "cd .." or using relative paths.
if ! git update-index -q --ignore-submodules --refresh
then
die "Up-to-date check failed"
fi
if ! git diff-files --quiet --ignore-submodules --
then
die "Working directory has unstaged changes"
fi
# This is a rough translation of:
#
# head_has_history() ? "HEAD" : EMPTY_TREE_SHA1_HEX
if git cat-file -e HEAD 2>/dev/null
then
head=HEAD
else
head=$(git hash-object -t tree --stdin </dev/null)
fi
if ! git diff-index --quiet --cached --ignore-submodules $head --
then
die "Working directory has staged changes"
fi
if ! git read-tree -u -m "$commit"
then
die "Could not update working tree to new HEAD"
fi

View File

@ -0,0 +1,128 @@
#!/bin/sh
#
# An example hook script to block unannotated tags from entering.
# Called by "git receive-pack" with arguments: refname sha1-old sha1-new
#
# To enable this hook, rename this file to "update".
#
# Config
# ------
# hooks.allowunannotated
# This boolean sets whether unannotated tags will be allowed into the
# repository. By default they won't be.
# hooks.allowdeletetag
# This boolean sets whether deleting tags will be allowed in the
# repository. By default they won't be.
# hooks.allowmodifytag
# This boolean sets whether a tag may be modified after creation. By default
# it won't be.
# hooks.allowdeletebranch
# This boolean sets whether deleting branches will be allowed in the
# repository. By default they won't be.
# hooks.denycreatebranch
# This boolean sets whether remotely creating branches will be denied
# in the repository. By default this is allowed.
#
# --- Command line
refname="$1"
oldrev="$2"
newrev="$3"
# --- Safety check
if [ -z "$GIT_DIR" ]; then
echo "Don't run this script from the command line." >&2
echo " (if you want, you could supply GIT_DIR then run" >&2
echo " $0 <ref> <oldrev> <newrev>)" >&2
exit 1
fi
if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
echo "usage: $0 <ref> <oldrev> <newrev>" >&2
exit 1
fi
# --- Config
allowunannotated=$(git config --type=bool hooks.allowunannotated)
allowdeletebranch=$(git config --type=bool hooks.allowdeletebranch)
denycreatebranch=$(git config --type=bool hooks.denycreatebranch)
allowdeletetag=$(git config --type=bool hooks.allowdeletetag)
allowmodifytag=$(git config --type=bool hooks.allowmodifytag)
# check for no description
projectdesc=$(sed -e '1q' "$GIT_DIR/description")
case "$projectdesc" in
"Unnamed repository"* | "")
echo "*** Project description file hasn't been set" >&2
exit 1
;;
esac
# --- Check types
# if $newrev is 0000...0000, it's a commit to delete a ref.
zero=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')
if [ "$newrev" = "$zero" ]; then
newrev_type=delete
else
newrev_type=$(git cat-file -t $newrev)
fi
case "$refname","$newrev_type" in
refs/tags/*,commit)
# un-annotated tag
short_refname=${refname##refs/tags/}
if [ "$allowunannotated" != "true" ]; then
echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2
echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2
exit 1
fi
;;
refs/tags/*,delete)
# delete tag
if [ "$allowdeletetag" != "true" ]; then
echo "*** Deleting a tag is not allowed in this repository" >&2
exit 1
fi
;;
refs/tags/*,tag)
# annotated tag
if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1
then
echo "*** Tag '$refname' already exists." >&2
echo "*** Modifying a tag is not allowed in this repository." >&2
exit 1
fi
;;
refs/heads/*,commit)
# branch
if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then
echo "*** Creating a branch is not allowed in this repository" >&2
exit 1
fi
;;
refs/heads/*,delete)
# delete branch
if [ "$allowdeletebranch" != "true" ]; then
echo "*** Deleting a branch is not allowed in this repository" >&2
exit 1
fi
;;
refs/remotes/*,commit)
# tracking branch
;;
refs/remotes/*,delete)
# delete tracking branch
if [ "$allowdeletebranch" != "true" ]; then
echo "*** Deleting a tracking branch is not allowed in this repository" >&2
exit 1
fi
;;
*)
# Anything else (is there anything else?)
echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2
exit 1
;;
esac
# --- Finished
exit 0

View File

@ -0,0 +1,6 @@
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~

View File

@ -0,0 +1,100 @@
# pack-refs with: peeled fully-peeled sorted
af5d288a9cecbef16046d0d4b9146d9a09b9d5ee refs/heads/4.2.0
07598687ff6e9a8c7bcdb24aa5e4fc8f5db3ed5b refs/heads/5.0.1
7d21bdd89d5274c364d028ce1d1bfd619da06c00 refs/heads/5.0.2
fce48c177cbd0db8d99a89dc6a596b7d417a9fd9 refs/heads/5.0.3
9b874ce4c7c8f0240064972a1f0ffbf96fc0c859 refs/heads/flobories/no_force_unwrap
14c2d65554d687c228b0097a2bcf4e15de5f697f refs/heads/master
dd57deda8535ab08e911af6dde328af1d6d3242e refs/heads/mp/remove_result
6638e21bbec93446890b40c0212e77634c862524 refs/heads/ms/develop
5374b644d8f52af01fb95e531ef9db1a2b53af89 refs/heads/ms/fix-leaks
f4c6adf59e3fb697901b3de67b72ba19d0ef251c refs/heads/ms/update-podspec
b2c5b40e05d4971c6f29f8032ee11dd86d961828 refs/heads/satish/xcode_deployment_target_update
e64608a8b2bf6fdba4c2c69fce3fd7fccba83eb2 refs/pull/1/head
2bb5c4c36eb695cf9a0d4105f5ed0b2e4213ca1a refs/pull/10/head
31ab562a98b20892e507f0eaf39a7c8ab5178613 refs/pull/105/head
882fd3aaffb10a7599df47bc48ddbc1a4cb8e1d5 refs/pull/105/merge
10460729d8c5634fb6b81c230e865a20b9d8197b refs/pull/107/head
c84fac183aced0a9ab8595ddde236620530375df refs/pull/107/merge
8e88e648f37c16720247c3f6c6f3752778a4214c refs/pull/111/head
40e2a3bcb7020533ccd997537644fb01ea6d35e9 refs/pull/111/merge
0b674d606472f58ce0789e2140af0544400685d6 refs/pull/115/head
19a80c2fca7516fe2dc614e5a4b5b65525c5e943 refs/pull/116/head
4637770e9c6d76af2fc4c16c43388e9a65104745 refs/pull/116/merge
70f2f498675817a13c2526932cb4736c45d98bd7 refs/pull/117/head
dcf5479b9f2b426bd660ccdc2f34342b2fedf553 refs/pull/117/merge
13fe425ffbf413c627ff8e7077a7f7ad7a6fd3c1 refs/pull/13/head
3b8f92f722bd73cb8d2296e3ea23602d70310c19 refs/pull/2/head
c0edece1f2ed5c39a075be6d8fb1e8791377caf9 refs/pull/20/head
636cfc24d145d5d6fb201f48578c360ae653b93b refs/pull/20/merge
045dc3f54b0e02e65d063d97340f87b5ddca3a6b refs/pull/21/head
3f69d511274afbb610ada90e40af167b45eb0b33 refs/pull/22/head
0f428e7d24a01be2f6df1cfce22809776ef1d2c9 refs/pull/25/head
8363df3d7e78e7fd1aff8e25e911572ae4daf12b refs/pull/26/head
ca0447c6807ef0acab087f98b2b209159b17c02d refs/pull/27/head
aeea123478e8d72a792be0a350fb318185f9eb3b refs/pull/28/head
870ecbb3044298eb17f6b1c9faf2ff4053b2ffc7 refs/pull/3/head
645e17eaad30e014ec5fed42cc8359d32221328b refs/pull/35/head
286a5080854aa42a6eae9dd3e060ca845921851d refs/pull/4/head
92241af2728b36ef734a23e986f440b900a8efb8 refs/pull/41/head
4f7a418117473b91a01ceac4cb9aeb683734931f refs/pull/43/head
06802f9b7fb08d5244dd3b2db17b72b68be81c38 refs/pull/43/merge
78c265d4b1755f645e71d8877dfc2d517e61596c refs/pull/49/head
b4d1f43c9418460732a42aec3ed63cab4b091f0d refs/pull/6/head
eec339c6ed04de4ac812cebc0d3aa94596259694 refs/pull/60/head
54e3924496eb85093063f2dbbc53761a8f4310a2 refs/pull/63/head
b71549c9aaf82be30733649cf6088b612cb40e20 refs/pull/65/head
52bd9936e392b1e3e6b7eb8a0feb100802f066bb refs/pull/67/head
0c6ea7168a63b32f0fb329a989d72403bc813203 refs/pull/68/head
edf4ff7df44f2fd29cbde359cfe0125d4200cdb2 refs/pull/7/head
b8e47dcfc65582078500b3598fe56cd4fa75bb57 refs/pull/71/head
8582bbc27ed2b70aac34fae4a00ccf68a420b74c refs/pull/72/head
dd57deda8535ab08e911af6dde328af1d6d3242e refs/pull/73/head
457580c83e120ff452356b4c53be8ac08f2bb3ab refs/pull/74/head
bb4f6922746fc9824362a7ded915b7c6c15aadc9 refs/pull/75/head
fce48c177cbd0db8d99a89dc6a596b7d417a9fd9 refs/pull/76/head
6be9ff167abd1a451de939afc224beef7d52974c refs/pull/8/head
3a04acd927b4c10efa48d6becd7d38a04a1e02ea refs/pull/86/head
7d6b475ad79d9f488c75e76dde00e030dee5c12c refs/pull/92/head
83ddab03e0d31cdbd5f6ce462d832c652eb2f798 refs/pull/92/merge
753434982cf09cb17372f6ff5ff339a030a71063 refs/tags/1.0.0
^96229093b18b511a51499672d136631c2fbf0598
39960a646d52d0df7868fdbb41affc2bac3fe722 refs/tags/1.0.1
^2819d7325dc4e804d0cc72ffcd056217b05191e7
7b9e18c35ff3d059e154782fd890895eec605086 refs/tags/1.1.0
^5ea760bf993a983d32e99a28948ffb4e124683f7
8c7c63b556f58e6b0dbe79531234285e06219ec3 refs/tags/2.0.0
^1203a257b18fa089f0fc9294affe4b2d0c135fb6
730dd1d5f86bbc177e7dfe2edaef6531d729fb02 refs/tags/2.1.0
b40a9aa4db48e2a7e275527bb749732f084d1cab refs/tags/2.1.1
^c67d831772255c973c0ef52f828ad7375ab6ca89
4f3f8c8eec918716e790af603565405716c1de10 refs/tags/3.0.0
a7434ded7df4d9553eafcb3a777c7738e77857ce refs/tags/3.1.0
^b80c1bea3c0a43762f821065fe692e8d86f38b9f
18d981ca6e5d8555118368964bdf53fc58813205 refs/tags/3.1.1
^2e63ee84b5400178acf2535c069ff9afb051a443
85bc4e867153d0bcdb72fa84e7da5d6fbb58b29b refs/tags/4.0.0
^a6e80508f717dc6386be45e3c3c51491411aa098
bbfa2defd6b0c0f5f4727ce476d7c1786ec5ce34 refs/tags/4.1.0
^86fc5eda625e8858cbc88610873f62e1217a0efc
bac1265d4cc1fc6c9e08d0dce7ad7fce63f5eedc refs/tags/4.1.1
^fe1a395e956bea82ca169b7be51e3752da3a116c
42fe9355f3e6c2e0bce372d1b12fc33ec0f62c0a refs/tags/4.1.2
^8ff1400232e0a9effc5168c0a843c579cd38505c
37ef69eae4159f58e3aaf0f03dc02b8cfcff61d3 refs/tags/4.1.3
^c1486a2112b61b13cc7e483d1ef0c28c1a59b0dc
73a2fedae46d469703f8452265cdb093f1a60b20 refs/tags/4.1.4
^82dae38d11bb8f487c7d0b62f3187c2ba93d4fb6
0a98d0086b2891fbf88ba0675ec3119fb62798fb refs/tags/4.1.5
^5d4c2dc7753518ac08e64ceac21378781c9cc721
fa538b1a7a8e07c5270316487851e653e63c701a refs/tags/4.2.0
^af5d288a9cecbef16046d0d4b9146d9a09b9d5ee
03b9db0c4d19939d716afc1f86cddceeb92aec80 refs/tags/5.0.0
^5c94191561fc51c14847b7e4b7b014af415c4bc6
ea1b6192f1c3416760ca1b6a4ab446c0edd1d798 refs/tags/5.0.1
^07598687ff6e9a8c7bcdb24aa5e4fc8f5db3ed5b
c737861ae5cbd0f16342db170e30bc61b583e8f3 refs/tags/5.0.2
^7d21bdd89d5274c364d028ce1d1bfd619da06c00
8b6f114d92c4a732850158403484ffddab3c4192 refs/tags/5.0.3
^fce48c177cbd0db8d99a89dc6a596b7d417a9fd9
14c2d65554d687c228b0097a2bcf4e15de5f697f refs/tags/5.1.0