From d17cf5f3a32f07bf8a6b8fb014abfa8e87fd7075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Kiedrowicz?= Date: Sat, 4 Aug 2012 00:21:04 +0200 Subject: [PATCH 1/9] tests: Introduce test_seq MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Jeff King wrote: The seq command is GNU-ism, and is missing at least in older BSD releases and their derivatives, not to mention antique commercial Unixes. We already purged it in b3431bc (Don't use seq in tests, not everyone has it, 2007-05-02), but a few new instances have crept in. They went unnoticed because they are in scripts that are not run by default. Replace them with test_seq that is implemented with a Perl snippet (proposed by Jeff). This is better than inlining this snippet everywhere it's needed because it's easier to read and it's easier to change the implementation (e.g. to C) if we ever decide to remove Perl from the test suite. Note that test_seq is not a complete replacement for seq(1). It just has what we need now, in addition that it makes it possible for us to do something like "test_seq a m" if we wanted to in the future. There are also many places that do `for i in 1 2 3 ...` but I'm not sure if it's worth converting them to test_seq. That would introduce running more processes of Perl. Signed-off-by: Michał Kiedrowicz Acked-by: Jeff King Signed-off-by: Junio C Hamano --- t/perf/perf-lib.sh | 2 +- t/t5551-http-fetch.sh | 2 +- t/test-lib-functions.sh | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh index 5580c2281..a1361e530 100644 --- a/t/perf/perf-lib.sh +++ b/t/perf/perf-lib.sh @@ -163,7 +163,7 @@ test_perf () { else echo "perf $test_count - $1:" fi - for i in $(seq 1 $GIT_PERF_REPEAT_COUNT); do + for i in $(test_seq 1 $GIT_PERF_REPEAT_COUNT); do say >&3 "running: $2" if test_run_perf_ "$2" then diff --git a/t/t5551-http-fetch.sh b/t/t5551-http-fetch.sh index fadf2f258..91eaf53d1 100755 --- a/t/t5551-http-fetch.sh +++ b/t/t5551-http-fetch.sh @@ -114,7 +114,7 @@ test -n "$GIT_TEST_LONG" && test_set_prereq EXPENSIVE test_expect_success EXPENSIVE 'create 50,000 tags in the repo' ' ( cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" && - for i in `seq 50000` + for i in `test_seq 50000` do echo "commit refs/heads/too-many-refs" echo "mark :$i" diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index 80daaca78..9096398b1 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -530,6 +530,27 @@ test_cmp() { $GIT_TEST_CMP "$@" } +# Print a sequence of numbers or letters in increasing order. This is +# similar to GNU seq(1), but the latter might not be available +# everywhere (and does not do letters). It may be used like: +# +# for i in `test_seq 100`; do +# for j in `test_seq 10 20`; do +# for k in `test_seq a z`; do +# echo $i-$j-$k +# done +# done +# done + +test_seq () { + case $# in + 1) set 1 "$@" ;; + 2) ;; + *) error "bug in the test script: not 1 or 2 parameters to test_seq" ;; + esac + "$PERL_PATH" -le 'print for $ARGV[0]..$ARGV[1]' -- "$@" +} + # This function can be used to schedule some commands to be run # unconditionally at the end of the test to restore sanity: # From 831e61f80fab2d3f9ba1773e657803dcf8b16432 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 6 Aug 2012 13:36:47 -0700 Subject: [PATCH 2/9] Documentation: do not mention .git/refs/* directories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is an implementation detail that a new tag is created by adding a file in the .git/refs/tags directory. The only thing the user needs to know is that a "git tag" creates a ref in the refs/tags namespace, and without "-f", it does not overwrite an existing tag. Inspired by a report from 乙酸鋰 ; I think I caught all the existing mention in Documentation/ directory in the tip of 1.7.9.X maintenance track, but we may have added new ones since then. Signed-off-by: Junio C Hamano --- Documentation/git-describe.txt | 4 ++-- Documentation/git-filter-branch.txt | 3 ++- Documentation/git-fsck.txt | 4 ++-- Documentation/git-lost-found.txt | 3 ++- Documentation/git-pack-refs.txt | 19 +++++++++++++++---- Documentation/git-replace.txt | 5 ++--- Documentation/git-tag.txt | 5 ++--- 7 files changed, 27 insertions(+), 16 deletions(-) diff --git a/Documentation/git-describe.txt b/Documentation/git-describe.txt index 039cce2e9..72d6bb612 100644 --- a/Documentation/git-describe.txt +++ b/Documentation/git-describe.txt @@ -36,12 +36,12 @@ OPTIONS --all:: Instead of using only the annotated tags, use any ref - found in `.git/refs/`. This option enables matching + found in `refs/` namespace. This option enables matching any known branch, remote-tracking branch, or lightweight tag. --tags:: Instead of using only the annotated tags, use any tag - found in `.git/refs/tags`. This option enables matching + found in `refs/tags` namespace. This option enables matching a lightweight (non-annotated) tag. --contains:: diff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt index 0f2f11738..924a38c96 100644 --- a/Documentation/git-filter-branch.txt +++ b/Documentation/git-filter-branch.txt @@ -32,7 +32,8 @@ changes, which would normally have no effect. Nevertheless, this may be useful in the future for compensating for some git bugs or such, therefore such a usage is permitted. -*NOTE*: This command honors `.git/info/grafts` and `.git/refs/replace/`. +*NOTE*: This command honors `.git/info/grafts` file and refs in +the `refs/replace/` namespace. If you have any grafts or replacement refs defined, running this command will make them permanent. diff --git a/Documentation/git-fsck.txt b/Documentation/git-fsck.txt index 6c47395ad..df9ea8df0 100644 --- a/Documentation/git-fsck.txt +++ b/Documentation/git-fsck.txt @@ -23,8 +23,8 @@ OPTIONS An object to treat as the head of an unreachability trace. + If no objects are given, 'git fsck' defaults to using the -index file, all SHA1 references in .git/refs/*, and all reflogs (unless ---no-reflogs is given) as heads. +index file, all SHA1 references in `refs` namespace, and all reflogs +(unless --no-reflogs is given) as heads. --unreachable:: Print out objects that exist but that aren't reachable from any diff --git a/Documentation/git-lost-found.txt b/Documentation/git-lost-found.txt index c406a1100..d54932889 100644 --- a/Documentation/git-lost-found.txt +++ b/Documentation/git-lost-found.txt @@ -48,7 +48,8 @@ $ gitk $(cd .git/lost-found/commit && echo ??*) ------------ After making sure you know which the object is the tag you are looking -for, you can reconnect it to your regular .git/refs hierarchy. +for, you can reconnect it to your regular `refs` hierarchy by using +the `update-ref` command. ------------ $ git cat-file -t 1ef2b196 diff --git a/Documentation/git-pack-refs.txt b/Documentation/git-pack-refs.txt index a3c6677bf..7664bd174 100644 --- a/Documentation/git-pack-refs.txt +++ b/Documentation/git-pack-refs.txt @@ -14,7 +14,8 @@ DESCRIPTION ----------- Traditionally, tips of branches and tags (collectively known as -'refs') were stored one file per ref under `$GIT_DIR/refs` +'refs') were stored one file per ref in a (sub)directory +under `$GIT_DIR/refs` directory. While many branch tips tend to be updated often, most tags and some branch tips are never updated. When a repository has hundreds or thousands of tags, this @@ -22,13 +23,14 @@ one-file-per-ref format both wastes storage and hurts performance. This command is used to solve the storage and performance -problem by stashing the refs in a single file, +problem by storing the refs in a single file, `$GIT_DIR/packed-refs`. When a ref is missing from the -traditional `$GIT_DIR/refs` hierarchy, it is looked up in this +traditional `$GIT_DIR/refs` directory hierarchy, it is looked +up in this file and used if found. Subsequent updates to branches always create new files under -`$GIT_DIR/refs` hierarchy. +`$GIT_DIR/refs` directory hierarchy. A recommended practice to deal with a repository with too many refs is to pack its refs with `--all --prune` once, and @@ -57,6 +59,15 @@ a repository with many branches of historical interests. The command usually removes loose refs under `$GIT_DIR/refs` hierarchy after packing them. This option tells it not to. + +BUGS +---- + +Older documentation written before the packed-refs mechanism was +introduced may still say things like ".git/refs/heads/ file +exists" when it means "branch exists". + + GIT --- Part of the linkgit:git[1] suite diff --git a/Documentation/git-replace.txt b/Documentation/git-replace.txt index 17df52527..51131d085 100644 --- a/Documentation/git-replace.txt +++ b/Documentation/git-replace.txt @@ -14,14 +14,13 @@ SYNOPSIS DESCRIPTION ----------- -Adds a 'replace' reference in `.git/refs/replace/` +Adds a 'replace' reference in `refs/replace/` namespace. The name of the 'replace' reference is the SHA1 of the object that is replaced. The content of the 'replace' reference is the SHA1 of the replacement object. -Unless `-f` is given, the 'replace' reference must not yet exist in -`.git/refs/replace/` directory. +Unless `-f` is given, the 'replace' reference must not yet exist. Replacement references will be used by default by all git commands except those doing reachability traversal (prune, pack transfer and diff --git a/Documentation/git-tag.txt b/Documentation/git-tag.txt index 53ff5f6cf..f7abf0bca 100644 --- a/Documentation/git-tag.txt +++ b/Documentation/git-tag.txt @@ -18,11 +18,10 @@ SYNOPSIS DESCRIPTION ----------- -Add a tag reference in `.git/refs/tags/`, unless `-d/-l/-v` is given +Add a tag reference in `refs/tags/`, unless `-d/-l/-v` is given to delete, list or verify tags. -Unless `-f` is given, the tag to be created must not yet exist in the -`.git/refs/tags/` directory. +Unless `-f` is given, the named tag must not yet exist. If one of `-a`, `-s`, or `-u ` is passed, the command creates a 'tag' object, and requires a tag message. Unless From 03b05c7db5473329f433c5a3b87965d6fa0f691f Mon Sep 17 00:00:00 2001 From: Heiko Voigt Date: Wed, 15 Aug 2012 19:06:01 +0200 Subject: [PATCH 3/9] Documentation/CodingGuidelines: spell out more shell guidelines In earlier days, "imitate the style in the neibouring code" was sufficient to keep the coherent style, but over time some parts of the codebase have drifted enough to make it ineffective. Spell some of the guidelines out. Signed-off-by: Heiko Voigt Signed-off-by: Junio C Hamano --- Documentation/CodingGuidelines | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines index 45577117c..57da6aade 100644 --- a/Documentation/CodingGuidelines +++ b/Documentation/CodingGuidelines @@ -76,11 +76,19 @@ For shell scripts specifically (not exhaustive): - We do not use Process Substitution <(list) or >(list). + - Do not write control structures on a single line with semicolon. + "then" should be on the next line for if statements, and "do" + should be on the next line for "while" and "for". + - We prefer "test" over "[ ... ]". - We do not write the noiseword "function" in front of shell functions. + - We prefer a space between the function name and the parentheses. The + opening "{" should also be on the same line. + E.g.: my_function () { + - As to use of grep, stick to a subset of BRE (namely, no \{m,n\}, [::], [==], nor [..]) for portability. From 3f0350ccd5378520d472fd5e5a8a9fb21db50762 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 15 Aug 2012 13:02:48 -0700 Subject: [PATCH 4/9] rev-list docs: clarify --topo-order description It was unclear what "--topo-order" was really about in the documentation. It is not just about "children before parent", but also about "don't mix lineages". Reword the description for both "--date-order" and "--topo-order", and add an illustration to it. Signed-off-by: Junio C Hamano --- Documentation/rev-list-options.txt | 31 +++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt index 6a4b6355b..9404d0867 100644 --- a/Documentation/rev-list-options.txt +++ b/Documentation/rev-list-options.txt @@ -578,16 +578,33 @@ Commit Ordering By default, the commits are shown in reverse chronological order. ---topo-order:: +--date-order:: + Show no parents before all of its children are shown, but + otherwise show commits in the commit timestamp order. - This option makes them appear in topological order (i.e. - descendant commits are shown before their parents). +--topo-order:: + Show no parents before all of its children are shown, and + avoid showing commits on multiple lines of history + intermixed. ++ +For example, in a commit history like this: ++ +---------------------------------------------------------------- ---date-order:: + ---1----2----4----7 + \ \ + 3----5----6----8--- - This option is similar to '--topo-order' in the sense that no - parent comes before all of its children, but otherwise things - are still ordered in the commit timestamp order. +---------------------------------------------------------------- ++ +where the numbers denote the order of commit timestamps, `git +rev-list` and friends with `--date-order` show the commits in the +timestamp order: 8 7 6 5 4 3 2 1. ++ +With `--topo-order`, they would show 8 6 5 3 7 4 2 1 (or 8 7 4 2 6 5 +3 1); some older commits are shown before newer ones in order to +avoid showing the commits from two parallel development track mixed +together. --reverse:: From 9c81990bdd9277dc791914c1db7dfadbe3592d3a Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 16 Aug 2012 23:16:22 -0700 Subject: [PATCH 5/9] gitcli: describe abbreviation of long options Signed-off-by: Junio C Hamano --- Documentation/gitcli.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/gitcli.txt b/Documentation/gitcli.txt index ea17f7a53..3e72a5d68 100644 --- a/Documentation/gitcli.txt +++ b/Documentation/gitcli.txt @@ -62,6 +62,14 @@ scripting git: `git log -1 HEAD` but write `git log -1 HEAD --`; the former will not work if you happen to have a file called `HEAD` in the work tree. + * many commands allow a long option "--option" to be abbreviated + only to their unique prefix (e.g. if there is no other option + whose name begins with "opt", you may be able to spell "--opt" to + invoke the "--option" flag), but you should fully spell them out + when writing your scripts; later versions of Git may introduce a + new option whose name shares the same prefix, e.g. "--optimize", + to make a short prefix that used to be unique no longer unique. + ENHANCED OPTION PARSER ---------------------- From d9aa3610437e8cfab86fe3d1e3433400de15773d Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 16 Aug 2012 11:50:18 +0200 Subject: [PATCH 6/9] man: git pull -r is a short for --rebase Letting the "--rebase" option squat on the short-and-sweet single letter option "-r" was an unintended accident and was not even documented, but the short option seems to be already used in the wild. Let's document it so that other options that begin with "r" would not be tempted to steal it. Signed-off-by: Miklos Vajna Signed-off-by: Junio C Hamano --- Documentation/git-pull.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt index defb544ed..67fa5ee19 100644 --- a/Documentation/git-pull.txt +++ b/Documentation/git-pull.txt @@ -101,6 +101,7 @@ include::merge-options.txt[] :git-pull: 1 +-r:: --rebase:: Rebase the current branch on top of the upstream branch after fetching. If there is a remote-tracking branch corresponding to From 64840701683b4126234b39da746b3cddb6db00a8 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 23 Aug 2012 00:10:53 -0400 Subject: [PATCH 7/9] Improved documentation for the ciabot scripts. Signed-off-by: Eric S. Raymond Signed-off-by: Junio C Hamano --- contrib/ciabot/INSTALL | 38 ++++++++++++++++++++++++++++++++++++++ contrib/ciabot/README | 14 ++++++++++++-- 2 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 contrib/ciabot/INSTALL diff --git a/contrib/ciabot/INSTALL b/contrib/ciabot/INSTALL new file mode 100644 index 000000000..8253865d2 --- /dev/null +++ b/contrib/ciabot/INSTALL @@ -0,0 +1,38 @@ += Installation instructions = + +Two scripts are included. The Python one (ciabot.py) is faster and +more capable; the shell one (ciabot.sh) is a fallback in case Python +gives your git hosting site indigestion. (I know of no such sites.) + +It is no longer necessary to modify the script in order to put it +in place; in fact, this is now discouraged. It is entirely +configurable with the following git config variables: + +ciabot.project = name of the project (required) +ciabot.repo = name of the project repo for gitweb/cgit purposes +ciabot.xmlrpc = if true (default), ship notifications via XML-RPC +ciabot.revformat = format in which the revision is shown + +The ciabot.repo value defaults to ciabot.project lowercased. + +The revformat variable may have the following values +raw -> full hex ID of commit +short -> first 12 chars of hex ID +describe -> describe relative to last tag, falling back to short +The default is 'describe'. + +Once you've set these variables, try your script with -n to see the +notification message dumped to stdout and verify that it looks sane. + +After verifying correct function, install one of these scripts either +in a post-commit hook or in an update hook. + +In post-commit, run it without arguments. It will query for +current HEAD and the latest commit ID to get the information it +needs. + +In update, call it with a refname followed by a list of commits: +You want to reverse the order git rev-list emits because it lists +from most recent to oldest. + +/path/to/ciabot.py ${refname} $(git rev-list ${oldhead}..${newhead} | tac) diff --git a/contrib/ciabot/README b/contrib/ciabot/README index 3b916acec..6d8b549f5 100644 --- a/contrib/ciabot/README +++ b/contrib/ciabot/README @@ -8,5 +8,15 @@ You probably want the Python version; it's faster, more capable, and better documented. The shell version is maintained only as a fallback for use on hosting sites that don't permit Python hook scripts. -You will find installation instructions for each script in its comment -header. +To test these scripts, your project needs to have been registered with +the CIA site. Here are the steps: + +1. Open an IRC window on irc://freenode/commits or your registered + project IRC channel. + +2. Run ciabot.py and/or ciabot.sh from any directory under git + control, using the -p option to pass in your project name. + +You should see a notification on the channel for your most recent commit. + +See the file INSTALL for installation instructions. From df1effa6909d07c859e4ade03dbea3e32e5595b4 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 23 Aug 2012 01:21:53 -0400 Subject: [PATCH 8/9] Make the ciabot scripts completely self-configuring in the normal case. Signed-off-by: Eric S. Raymond Signed-off-by: Junio C Hamano --- contrib/ciabot/INSTALL | 26 +++++++++++++++++++++----- contrib/ciabot/README | 11 ----------- contrib/ciabot/ciabot.py | 32 +++++++++++++++++++++----------- contrib/ciabot/ciabot.sh | 40 ++++++++++++++++++++++++++++++---------- 4 files changed, 72 insertions(+), 37 deletions(-) diff --git a/contrib/ciabot/INSTALL b/contrib/ciabot/INSTALL index 8253865d2..7222961d3 100644 --- a/contrib/ciabot/INSTALL +++ b/contrib/ciabot/INSTALL @@ -8,22 +8,38 @@ It is no longer necessary to modify the script in order to put it in place; in fact, this is now discouraged. It is entirely configurable with the following git config variables: -ciabot.project = name of the project (required) +ciabot.project = name of the project ciabot.repo = name of the project repo for gitweb/cgit purposes -ciabot.xmlrpc = if true (default), ship notifications via XML-RPC +ciabot.xmlrpc = if true, ship notifications via XML-RPC ciabot.revformat = format in which the revision is shown -The ciabot.repo value defaults to ciabot.project lowercased. - The revformat variable may have the following values raw -> full hex ID of commit short -> first 12 chars of hex ID describe -> describe relative to last tag, falling back to short -The default is 'describe'. + +ciabot.project defaults to the directory name of the repository toplevel. +ciabot.repo defaults to ciabot.project lowercased. +ciabot.xmlrpc defaults to True +ciabot.revformat defaults to 'describe'. + +This means that in the normal case you need not do any configuration at all, +however setting ciabot.project will allow the hook to run slightly faster. Once you've set these variables, try your script with -n to see the notification message dumped to stdout and verify that it looks sane. +To live-test these scripts, your project needs to have been registered with +the CIA site. Here are the steps: + +1. Open an IRC window on irc://freenode/commits or your registered + project IRC channel. + +2. Run ciabot.py and/or ciabot.sh from any directory under git + control. + +You should see a notification on the channel for your most recent commit. + After verifying correct function, install one of these scripts either in a post-commit hook or in an update hook. diff --git a/contrib/ciabot/README b/contrib/ciabot/README index 6d8b549f5..2dfe1f91f 100644 --- a/contrib/ciabot/README +++ b/contrib/ciabot/README @@ -8,15 +8,4 @@ You probably want the Python version; it's faster, more capable, and better documented. The shell version is maintained only as a fallback for use on hosting sites that don't permit Python hook scripts. -To test these scripts, your project needs to have been registered with -the CIA site. Here are the steps: - -1. Open an IRC window on irc://freenode/commits or your registered - project IRC channel. - -2. Run ciabot.py and/or ciabot.sh from any directory under git - control, using the -p option to pass in your project name. - -You should see a notification on the channel for your most recent commit. - See the file INSTALL for installation instructions. diff --git a/contrib/ciabot/ciabot.py b/contrib/ciabot/ciabot.py index 8ce04eb9d..bd24395d4 100755 --- a/contrib/ciabot/ciabot.py +++ b/contrib/ciabot/ciabot.py @@ -10,11 +10,9 @@ # usage: ciabot.py [-V] [-n] [-p projectname] [refname [commits...]] # # This script is meant to be run either in a post-commit hook or in an -# update hook. If there's nothing unusual about your hosting setup, -# you can specify the project name and repo with config variables and -# avoid having to modify this script. Try it with -n to see the -# notification mail dumped to stdout and verify that it looks -# sane. With -V it dumps its version and exits. +# update hook. Try it with -n to see the notification mail dumped to +# stdout and verify that it looks sane. With -V it dumps its version +# and exits. # # In post-commit, run it without arguments. It will query for # current HEAD and the latest commit ID to get the information it @@ -27,12 +25,17 @@ # /path/to/ciabot.py ${refname} $(git rev-list ${oldhead}..${newhead} | tac) # # Configuration variables affecting this script: -# ciabot.project = name of the project (required) +# +# ciabot.project = name of the project # ciabot.repo = name of the project repo for gitweb/cgit purposes # ciabot.xmlrpc = if true (default), ship notifications via XML-RPC # ciabot.revformat = format in which the revision is shown # -# The ciabot.repo value defaults to ciabot.project lowercased. +# ciabot.project defaults to the directory name of the repository toplevel. +# ciabot.repo defaults to ciabot.project lowercased. +# +# This means that in the normal case you need not do any configuration at all, +# but setting the project name will speed it up slightly. # # The revformat variable may have the following values # raw -> full hex ID of commit @@ -102,7 +105,7 @@ # Identify the generator script. # Should only change when the script itself gets a new home and maintainer. generator = "http://www.catb.org/~esr/ciabot.py" -version = "3.5" +version = "3.6" def do(command): return commands.getstatusoutput(command)[1] @@ -192,10 +195,17 @@ def report(refname, merged, xmlrpc=True): print "ciabot.py: version", version sys.exit(0) - # Cough and die if user has not specified a project + # The project variable defaults to the name of the repository toplevel. if not project: - sys.stderr.write("ciabot.py: no project specified, bailing out.\n") - sys.exit(1) + here = os.getcwd() + while True: + if os.path.exists(os.path.join(here, ".git")): + project = os.path.basename(here) + break + elif here == '/': + sys.stderr.write("ciabot.py: no .git below root!\n") + sys.exit(1) + here = os.path.dirname(here) if not repo: repo = project.lower() diff --git a/contrib/ciabot/ciabot.sh b/contrib/ciabot/ciabot.sh index dde74004c..3fbbc534a 100755 --- a/contrib/ciabot/ciabot.sh +++ b/contrib/ciabot/ciabot.sh @@ -21,11 +21,9 @@ # usage: ciabot.sh [-V] [-n] [-p projectname] [refname commit] # # This script is meant to be run either in a post-commit hook or in an -# update hook. If there's nothing unusual about your hosting setup, -# you can specify the project name and repo with config variables and -# avoid having to modify this script. Try it with -n to see the -# notification mail dumped to stdout and verify that it looks -# sane. With -V it dumps its version and exits. +# update hook. Try it with -n to see the notification mail dumped to +# stdout and verify that it looks sane. With -V it dumps its version +# and exits. # # In post-commit, run it without arguments. It will query for # current HEAD and the latest commit ID to get the information it @@ -44,11 +42,16 @@ # most recent to least - better to ship notifactions from oldest to newest. # # Configuration variables affecting this script: -# ciabot.project = name of the project (makes -p option unnecessary) +# +# ciabot.project = name of the project # ciabot.repo = name of the project repo for gitweb/cgit purposes # ciabot.revformat = format in which the revision is shown # -# The ciabot.repo defaults to ciabot.project lowercased. +# ciabot.project defaults to the directory name of the repository toplevel. +# ciabot.repo defaults to ciabot.project lowercased. +# +# This means that in the normal case you need not do any configuration at all, +# but setting the project name will speed it up slightly. # # The revformat variable may have the following values # raw -> full hex ID of commit @@ -64,10 +67,27 @@ # shpped from an update in their actual order.) # -# The project as known to CIA. You can also hardwire this or set it with a -# -p option. +# The project as known to CIA. You can set this with a -p option, +# or let it default to the directory name of the repo toplevel. project=$(git config --get ciabot.project) +if [ -z $project ] +then + here=`pwd`; + while :; do + if [ -d $here/.git ] + then + project=`basename $here` + break + elif [ $here = '/' ] + then + echo "ciabot.sh: no .git below root!" + exit 1 + fi + here=`dirname $here` + done +fi + # Name of the repo for gitweb/cgit purposes repo=$(git config --get ciabot.repo) [ -z $repo] && repo=$(echo "${project}" | tr '[A-Z]' '[a-z]') @@ -100,7 +120,7 @@ urlprefix="http://${host}/cgi-bin/cgit.cgi/${repo}/commit/?id=" # Identify the script. The 'generator' variable should change only # when the script itself gets a new home and maintainer. generator="http://www.catb.org/~esr/ciabot/ciabot.sh" -version=3.4 +version=3.5 # Addresses for the e-mail from="CIABOT-NOREPLY@${hostname}" From b52183179bb0a97ea4d91d1248aca303d8e8f892 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 24 Aug 2012 12:33:31 -0700 Subject: [PATCH 9/9] Prepare for 1.7.11.6 Signed-off-by: Junio C Hamano --- Documentation/RelNotes/1.7.11.6.txt | 34 +++++++++++++++++++++++++++++ RelNotes | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 Documentation/RelNotes/1.7.11.6.txt diff --git a/Documentation/RelNotes/1.7.11.6.txt b/Documentation/RelNotes/1.7.11.6.txt new file mode 100644 index 000000000..e548a5982 --- /dev/null +++ b/Documentation/RelNotes/1.7.11.6.txt @@ -0,0 +1,34 @@ +Git v1.7.11.6 Release Notes +=========================== + +Fixes since v1.7.11.5 +--------------------- + +This is primarily documentation and low-impact code clarification. + + - "ciabot" script (in contrib/) has been updated with extensive + documentation. + + - The "--rebase" option to "git pull" can be abbreviated to "-r", + but we didn't document it. + + - It was generally understood that "--long-option"s to many of our + subcommands can be abbreviated to the unique prefix, but it was not + easy to find it described for new readers of the documentation set. + + - The "--topo-order", "--date-order" (and the lack of either means + the default order) options to "rev-list" and "log" family of + commands were poorly described in the documentation. + + - Older parts of the documentation described as if having a regular + file in .git/refs/ hierarchy were the only way to have branches and + tags, which is not true for quite some time. + + - A utility shell function test_seq has been added as a replacement + for the 'seq' utility found on some platforms. + + - Fallback 'getpass' implementation made unportable use of stdio API. + + - "git commit --amend" let the user edit the log message and then + died when the human-readable committer name was given + insufficiently by getpwent(3). diff --git a/RelNotes b/RelNotes index f6490be2e..d04f1ae46 120000 --- a/RelNotes +++ b/RelNotes @@ -1 +1 @@ -Documentation/RelNotes/1.7.11.5.txt \ No newline at end of file +Documentation/RelNotes/1.7.11.6.txt \ No newline at end of file