From 7ee3760e2c8f181f22d4b80afc03309e4f764385 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Mon, 16 Mar 2009 18:03:11 +0100 Subject: [PATCH 01/13] test-lib.sh: Test for presence of git-init in the right path. It just happens so that when GIT_EXEC_PATH points to a compiled checkout of git.git it contains "git". Since this is not true in general make test-lib check for "git-init" which is always in GIT_EXEC_PATH. Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- t/test-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/test-lib.sh b/t/test-lib.sh index 1e01a912ab..dace24c541 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -454,7 +454,7 @@ test_create_repo () { repo="$1" mkdir -p "$repo" cd "$repo" || error "Cannot setup test environment" - "$GIT_EXEC_PATH/git" init "--template=$owd/../templates/blt/" >&3 2>&4 || + "$GIT_EXEC_PATH/git-init" "--template=$owd/../templates/blt/" >&3 2>&4 || error "cannot run git init -- have you built things yet?" mv .git/hooks .git/hooks-disabled cd "$owd" From 6720721e152aee230387546efac865319f025597 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Mon, 16 Mar 2009 18:03:12 +0100 Subject: [PATCH 02/13] test-lib.sh: Allow running the test suite against installed git Introduce variables GIT_TEST_INSTALLED and GIT_TEST_EXEC_PATH such that the test suite can be run against a git which is installed at GIT_TEST_INSTALLED with subcommands at GIT_TEST_EXEC_PATH. GIT_TEST_INSTALLED defaults to the git.git checkout, GIT_TEST_EXEC_PATH defaults to the output of '$GIT_TEST_INSTALLED/git --exec-path'. Run the suite e.g. as GIT_TEST_INSTALLED=/some/path make test but note that this requires and uses parts of a compiled git in the git.git checkout: test helpers, templates and perl libraries are taken from there. Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- t/test-lib.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/t/test-lib.sh b/t/test-lib.sh index dace24c541..a70b633dd9 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -514,8 +514,16 @@ test_done () { TEST_DIRECTORY=$(pwd) if test -z "$valgrind" then - PATH=$TEST_DIRECTORY/..:$PATH - GIT_EXEC_PATH=$TEST_DIRECTORY/.. + if test -z "$GIT_TEST_INSTALLED" + then + PATH=$TEST_DIRECTORY/..:$PATH + GIT_EXEC_PATH=$TEST_DIRECTORY/.. + else + GIT_EXEC_PATH=$($GIT_TEST_INSTALLED/git --exec-path) || + error "Cannot run git from $GIT_TEST_INSTALLED." + PATH=$GIT_TEST_INSTALLED:$TEST_DIRECTORY/..:$PATH + GIT_EXEC_PATH=${GIT_TEST_EXEC_PATH:-$GIT_EXEC_PATH} + fi else make_symlink () { test -h "$2" && From 3f7cdf32996a9213a3085b182960f5ce2c0a6568 Mon Sep 17 00:00:00 2001 From: "David J. Mellor" Date: Mon, 16 Mar 2009 23:16:14 -0700 Subject: [PATCH 03/13] Documentation: minor grammatical fixes in git-archive.txt. Signed-off-by: David J. Mellor Signed-off-by: Junio C Hamano --- Documentation/git-archive.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt index 5b3eb12c8a..ad38f7f39d 100644 --- a/Documentation/git-archive.txt +++ b/Documentation/git-archive.txt @@ -22,7 +22,7 @@ prepended to the filenames in the archive. 'git-archive' behaves differently when given a tree ID versus when given a commit ID or tag ID. In the first case the current time is -used as modification time of each file in the archive. In the latter +used as the modification time of each file in the archive. In the latter case the commit time as recorded in the referenced commit object is used instead. Additionally the commit ID is stored in a global extended pax header if the tar format is used; it can be extracted @@ -48,11 +48,11 @@ OPTIONS Prepend / to each filename in the archive. :: - This can be any options that the archiver backend understand. + This can be any options that the archiver backend understands. See next section. --remote=:: - Instead of making a tar archive from local repository, + Instead of making a tar archive from the local repository, retrieve a tar archive from a remote repository. --exec=:: @@ -105,7 +105,7 @@ EXAMPLES git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/ && tar xf -):: Create a tar archive that contains the contents of the - latest commit on the current branch, and extracts it in + latest commit on the current branch, and extract it in the `/var/tmp/junk` directory. git archive --format=tar --prefix=git-1.4.0/ v1.4.0 | gzip >git-1.4.0.tar.gz:: From 236425919b6f2904ba34ed85bbde5e33ecc19f46 Mon Sep 17 00:00:00 2001 From: "David J. Mellor" Date: Mon, 16 Mar 2009 23:16:15 -0700 Subject: [PATCH 04/13] Documentation: reword the "Description" section of git-bisect.txt. Reword this section to make it less chatty. Also make minor grammatical fixes. Signed-off-by: David J. Mellor Signed-off-by: Junio C Hamano --- Documentation/git-bisect.txt | 154 +++++++++++++++++------------------ 1 file changed, 77 insertions(+), 77 deletions(-) diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt index 147ea38197..ef82bb8585 100644 --- a/Documentation/git-bisect.txt +++ b/Documentation/git-bisect.txt @@ -3,7 +3,7 @@ git-bisect(1) NAME ---- -git-bisect - Find the change that introduced a bug by binary search +git-bisect - Find by binary search the change that introduced a bug SYNOPSIS @@ -39,7 +39,8 @@ help" or "git bisect -h" to get a long usage description. Basic bisect commands: start, bad, good ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The way you use it is: +Using the Linux kernel tree as an example, basic use of the bisect +command is as follows: ------------------------------------------------ $ git bisect start @@ -48,61 +49,62 @@ $ git bisect good v2.6.13-rc2 # v2.6.13-rc2 was the last version # tested that was good ------------------------------------------------ -When you give at least one bad and one good versions, it will bisect -the revision tree and say something like: +When you have specified at least one bad and one good version, the +command bisects the revision tree and outputs something similar to: ------------------------------------------------ Bisecting: 675 revisions left to test after this ------------------------------------------------ -and check out the state in the middle. Now, compile that kernel, and -boot it. Now, let's say that this booted kernel works fine, then just -do +and then checks out the state in the middle. You would now compile +that kernel and boot it. If the booted kernel works correctly, you +would then issue the following command: ------------------------------------------------ $ git bisect good # this one is good ------------------------------------------------ -which will now say +which would then output something similar to: ------------------------------------------------ Bisecting: 337 revisions left to test after this ------------------------------------------------ and you continue along, compiling that one, testing it, and depending -on whether it is good or bad, you say "git bisect good" or "git bisect -bad", and ask for the next bisection. +on whether it is good or bad issuing the command "git bisect good" +or "git bisect bad" to ask for the next bisection. -Until you have no more left, and you'll have been left with the first -bad kernel rev in "refs/bisect/bad". +Eventually there will be no more revisions left to bisect, and you +will have been left with the first bad kernel revision in "refs/bisect/bad". Bisect reset ~~~~~~~~~~~~ -Oh, and then after you want to reset to the original head, do a +To return to the original head after a bisect session, you issue the +command: ------------------------------------------------ $ git bisect reset ------------------------------------------------ -to get back to the original branch, instead of being on the bisection -commit ("git bisect start" will do that for you too, actually: it will -reset the bisection state). +This resets the tree to the original branch instead of being on the +bisection commit ("git bisect start" will also do that, as it resets +the bisection state). Bisect visualize ~~~~~~~~~~~~~~~~ -During the bisection process, you can say +During the bisection process, you issue the command: ------------ $ git bisect visualize ------------ -to see the currently remaining suspects in 'gitk'. `visualize` is a bit -too long to type and `view` is provided as a synonym. +to see the currently remaining suspects in 'gitk'. `view` may also +be used as a synonym for `visualize`. -If 'DISPLAY' environment variable is not set, 'git log' is used -instead. You can even give command line options such as `-p` and +If the 'DISPLAY' environment variable is not set, 'git log' is used +instead. You can also give command line options such as `-p` and `--stat`. ------------ @@ -112,57 +114,56 @@ $ git bisect view --stat Bisect log and bisect replay ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The good/bad input is logged, and +The good/bad input is logged, and: ------------ $ git bisect log ------------ shows what you have done so far. You can truncate its output somewhere -and save it in a file, and run +and save it in a file, and run: ------------ $ git bisect replay that-file ------------ -if you find later you made a mistake telling good/bad about a -revision. +if you find later that you made a mistake specifying revisions as good/bad. -Avoiding to test a commit +Avoiding testing a commit ~~~~~~~~~~~~~~~~~~~~~~~~~ -If in a middle of bisect session, you know what the bisect suggested -to try next is not a good one to test (e.g. the change the commit +If in the middle of a bisect session, you know that the next suggested +revision is not a good one to test (e.g. the change the commit introduces is known not to work in your environment and you know it does not have anything to do with the bug you are chasing), you may -want to find a near-by commit and try that instead. +want to find a nearby commit and try that instead. -It goes something like this: +For example: ------------ $ git bisect good/bad # previous round was good/bad. Bisecting: 337 revisions left to test after this $ git bisect visualize # oops, that is uninteresting. -$ git reset --hard HEAD~3 # try 3 revs before what +$ git reset --hard HEAD~3 # try 3 revisions before what # was suggested ------------ -Then compile and test the one you chose to try. After that, tell -bisect what the result was as usual. +Then compile and test the chosen revision. Afterwards the revision +is marked as good/bad in the usual manner. Bisect skip ~~~~~~~~~~~~ -Instead of choosing by yourself a nearby commit, you may just want git -to do it for you using: +Instead of choosing by yourself a nearby commit, you can ask git +to do it for you by issuing the command: ------------ $ git bisect skip # Current version cannot be tested ------------ But computing the commit to test may be slower afterwards and git may -eventually not be able to tell the first bad among a bad and one or -more "skip"ped commits. +eventually not be able to tell the first bad commit among a bad commit +and one or more skipped commits. You can even skip a range of commits, instead of just one commit, using the "''..''" notation. For example: @@ -174,30 +175,29 @@ $ git bisect skip v2.5..v2.6 would mean that no commit between `v2.5` excluded and `v2.6` included can be tested. -Note that if you want to also skip the first commit of a range you can -use something like: +Note that if you also want to skip the first commit of the range you +would issue the command: ------------ $ git bisect skip v2.5 v2.5..v2.6 ------------ -and the commit pointed to by `v2.5` will be skipped too. +and the commit pointed to by `v2.5` would also be skipped. Cutting down bisection by giving more parameters to bisect start ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -You can further cut down the number of trials if you know what part of -the tree is involved in the problem you are tracking down, by giving -paths parameters when you say `bisect start`, like this: +You can further cut down the number of trials, if you know what part of +the tree is involved in the problem you are tracking down, by specifying +path parameters when issuing the `bisect start` command, like this: ------------ $ git bisect start -- arch/i386 include/asm-i386 ------------ -If you know beforehand more than one good commits, you can narrow the -bisect space down without doing the whole tree checkout every time you -give good commits. You give the bad revision immediately after `start` -and then you give all the good revisions you have: +If you know beforehand more than one good commit, you can narrow the +bisect space down by specifying all of the good commits immediately after +the bad commit when issuing the `bisect start` command: ------------ $ git bisect start v2.6.20-rc6 v2.6.20-rc4 v2.6.20-rc1 -- @@ -209,38 +209,38 @@ Bisect run ~~~~~~~~~~ If you have a script that can tell if the current source code is good -or bad, you can automatically bisect using: +or bad, you can bisect by issuing the command: ------------ $ git bisect run my_script ------------ -Note that the "run" script (`my_script` in the above example) should -exit with code 0 in case the current source code is good. Exit with a +Note that the script (`my_script` in the above example) should +exit with code 0 if the current source code is good, and exit with a code between 1 and 127 (inclusive), except 125, if the current source code is bad. -Any other exit code will abort the automatic bisect process. (A -program that does "exit(-1)" leaves $? = 255, see exit(3) manual page, -the value is chopped with "& 0377".) +Any other exit code will abort the bisect process. It should be noted +that a program that terminates via "exit(-1)" leaves $? = 255, (see the +exit(3) manual page), as the value is chopped with "& 0377". The special exit code 125 should be used when the current source code -cannot be tested. If the "run" script exits with this code, the current -revision will be skipped, see `git bisect skip` above. +cannot be tested. If the script exits with this code, the current +revision will be skipped (see `git bisect skip` above). -You may often find that during bisect you want to have near-constant -tweaks (e.g., s/#define DEBUG 0/#define DEBUG 1/ in a header file, or -"revision that does not have this commit needs this patch applied to -work around other problem this bisection is not interested in") -applied to the revision being tested. +You may often find that during a bisect session you want to have +temporary modifications (e.g. s/#define DEBUG 0/#define DEBUG 1/ in a +header file, or "revision that does not have this commit needs this +patch applied to work around another problem this bisection is not +interested in") applied to the revision being tested. To cope with such a situation, after the inner 'git bisect' finds the -next revision to test, with the "run" script, you can apply that tweak -before compiling, run the real test, and after the test decides if the -revision (possibly with the needed tweaks) passed the test, rewind the -tree to the pristine state. Finally the "run" script can exit with -the status of the real test to let the "git bisect run" command loop to -determine the outcome. +next revision to test, the script can apply the patch +before compiling, run the real test, and afterwards decide if the +revision (possibly with the needed patch) passed the test and then +rewind the tree to the pristine state. Finally the script should exit +with the status of the real test to let the "git bisect run" command loop +to determine the eventual outcome of the bisect session. EXAMPLES -------- @@ -257,39 +257,39 @@ $ git bisect run make # "make" builds the app ------------ $ cat ~/test.sh #!/bin/sh -make || exit 125 # this "skip"s broken builds +make || exit 125 # this skips broken builds make test # "make test" runs the test suite $ git bisect start v1.3 v1.1 -- # v1.3 is bad, v1.1 is good $ git bisect run ~/test.sh ------------ + Here we use a "test.sh" custom script. In this script, if "make" -fails, we "skip" the current commit. +fails, we skip the current commit. + -It's safer to use a custom script outside the repo to prevent +It is safer to use a custom script outside the repository to prevent interactions between the bisect, make and test processes and the script. + -And "make test" should "exit 0", if the test suite passes, and -"exit 1" (for example) otherwise. +"make test" should "exit 0", if the test suite passes, and +"exit 1" otherwise. * Automatically bisect a broken test case: + ------------ $ cat ~/test.sh #!/bin/sh -make || exit 125 # this "skip"s broken builds +make || exit 125 # this skips broken builds ~/check_test_case.sh # does the test case passes ? $ git bisect start HEAD HEAD~10 -- # culprit is among the last 10 $ git bisect run ~/test.sh ------------ + -Here "check_test_case.sh" should "exit 0", if the test case passes, -and "exit 1" (for example) otherwise. +Here "check_test_case.sh" should "exit 0" if the test case passes, +and "exit 1" otherwise. + -It's safer if both "test.sh" and "check_test_case.sh" scripts are -outside the repo to prevent interactions between the bisect, make and -test processes and the scripts. +It is safer if both "test.sh" and "check_test_case.sh" scripts are +outside the repository to prevent interactions between the bisect, +make and test processes and the scripts. Author ------ From b89510f024d228ad1c2f0fb4752157c18cc10d82 Mon Sep 17 00:00:00 2001 From: "David J. Mellor" Date: Mon, 16 Mar 2009 23:16:16 -0700 Subject: [PATCH 05/13] Documentation: minor grammatical fixes in git-blame.txt. Signed-off-by: David J. Mellor Signed-off-by: Junio C Hamano --- Documentation/blame-options.txt | 2 +- Documentation/git-blame.txt | 56 ++++++++++++++++----------------- Documentation/mailmap.txt | 17 +++++----- 3 files changed, 37 insertions(+), 38 deletions(-) diff --git a/Documentation/blame-options.txt b/Documentation/blame-options.txt index df2a7c1641..26cfb62195 100644 --- a/Documentation/blame-options.txt +++ b/Documentation/blame-options.txt @@ -39,7 +39,7 @@ of lines before or after the line given by . Show raw timestamp (Default: off). -S :: - Use revs from revs-file instead of calling linkgit:git-rev-list[1]. + Use revisions from revs-file instead of calling linkgit:git-rev-list[1]. --reverse:: Walk history forward instead of backward. Instead of showing diff --git a/Documentation/git-blame.txt b/Documentation/git-blame.txt index 4ef54d6602..8c7b7b0838 100644 --- a/Documentation/git-blame.txt +++ b/Documentation/git-blame.txt @@ -18,9 +18,9 @@ DESCRIPTION Annotates each line in the given file with information from the revision which last modified the line. Optionally, start annotating from the given revision. -Also it can limit the range of lines annotated. +The command can also limit the range of lines annotated. -This report doesn't tell you anything about lines which have been deleted or +The report does not tell you anything about lines which have been deleted or replaced; you need to use a tool such as 'git-diff' or the "pickaxe" interface briefly mentioned in the following paragraph. @@ -48,26 +48,26 @@ include::blame-options.txt[] lines between files (see `-C`) and lines moved within a file (see `-M`). The first number listed is the score. This is the number of alphanumeric characters detected - to be moved between or within files. This must be above + as having been moved between or within files. This must be above a certain threshold for 'git-blame' to consider those lines of code to have been moved. -f:: --show-name:: - Show filename in the original commit. By default - filename is shown if there is any line that came from a - file with different name, due to rename detection. + Show the filename in the original commit. By default + the filename is shown if there is any line that came from a + file with a different name, due to rename detection. -n:: --show-number:: - Show line number in the original commit (Default: off). + Show the line number in the original commit (Default: off). -s:: - Suppress author name and timestamp from the output. + Suppress the author name and timestamp from the output. -w:: - Ignore whitespace when comparing parent's version and - child's to find where the lines came from. + Ignore whitespace when comparing the parent's version and + the child's to find where the lines came from. THE PORCELAIN FORMAT @@ -79,17 +79,17 @@ header at the minimum has the first line which has: - 40-byte SHA-1 of the commit the line is attributed to; - the line number of the line in the original file; - the line number of the line in the final file; -- on a line that starts a group of line from a different +- on a line that starts a group of lines from a different commit than the previous one, the number of lines in this group. On subsequent lines this field is absent. This header line is followed by the following information at least once for each commit: -- author name ("author"), email ("author-mail"), time +- the author name ("author"), email ("author-mail"), time ("author-time"), and timezone ("author-tz"); similarly for committer. -- filename in the commit the line is attributed to. +- the filename in the commit that the line is attributed to. - the first line of the commit log message ("summary"). The contents of the actual line is output after the above @@ -100,23 +100,23 @@ header elements later. SPECIFYING RANGES ----------------- -Unlike 'git-blame' and 'git-annotate' in older git, the extent -of annotation can be limited to both line ranges and revision +Unlike 'git-blame' and 'git-annotate' in older versions of git, the extent +of the annotation can be limited to both line ranges and revision ranges. When you are interested in finding the origin for -ll. 40-60 for file `foo`, you can use `-L` option like these +lines 40-60 for file `foo`, you can use the `-L` option like so (they mean the same thing -- both ask for 21 lines starting at line 40): git blame -L 40,60 foo git blame -L 40,+21 foo -Also you can use regular expression to specify the line range. +Also you can use a regular expression to specify the line range: git blame -L '/^sub hello {/,/^}$/' foo -would limit the annotation to the body of `hello` subroutine. +which limits the annotation to the body of the `hello` subroutine. -When you are not interested in changes older than the version +When you are not interested in changes older than version v2.6.18, or changes older than 3 weeks, you can use revision range specifiers similar to 'git-rev-list': @@ -129,7 +129,7 @@ commit v2.6.18 or the most recent commit that is more than 3 weeks old in the above example) are blamed for that range boundary commit. -A particularly useful way is to see if an added file have lines +A particularly useful way is to see if an added file has lines created by copy-and-paste from existing files. Sometimes this indicates that the developer was being sloppy and did not refactor the code properly. You can first find the commit that @@ -162,26 +162,26 @@ annotated. + Line numbers count from 1. -. The first time that commit shows up in the stream, it has various +. The first time that a commit shows up in the stream, it has various other information about it printed out with a one-word tag at the - beginning of each line about that "extended commit info" (author, - email, committer, dates, summary etc). + beginning of each line describing the extra commit information (author, + email, committer, dates, summary, etc.). -. Unlike Porcelain format, the filename information is always +. Unlike the Porcelain format, the filename information is always given and terminates the entry: "filename" + -and thus it's really quite easy to parse for some line- and word-oriented +and thus it is really quite easy to parse for some line- and word-oriented parser (which should be quite natural for most scripting languages). + [NOTE] For people who do parsing: to make it more robust, just ignore any -lines in between the first and last one ("" and "filename" lines) -where you don't recognize the tag-words (or care about that particular +lines between the first and last one ("" and "filename" lines) +where you do not recognize the tag words (or care about that particular one) at the beginning of the "extended information" lines. That way, if there is ever added information (like the commit encoding or extended -commit commentary), a blame viewer won't ever care. +commit commentary), a blame viewer will not care. MAPPING AUTHORS diff --git a/Documentation/mailmap.txt b/Documentation/mailmap.txt index e25b154838..288f04e70c 100644 --- a/Documentation/mailmap.txt +++ b/Documentation/mailmap.txt @@ -5,22 +5,21 @@ canonical real names and email addresses. In the simple form, each line in the file consists of the canonical real name of an author, whitespace, and an email address used in the -commit (enclosed by '<' and '>') to map to the name. Thus, looks like -this +commit (enclosed by '<' and '>') to map to the name. For example: -- Proper Name -- -The more complex forms are +The more complex forms are: -- -- -which allows mailmap to replace only the email part of a commit, and +which allows mailmap to replace only the email part of a commit, and: -- Proper Name -- which allows mailmap to replace both the name and the email of a -commit matching the specified commit email address, and +commit matching the specified commit email address, and: -- Proper Name Commit Name -- @@ -47,8 +46,8 @@ Jane Doe Joe R. Developer ------------ -Note how we don't need an entry for , because the -real name of that author is correct already. +Note how there is no need for an entry for , because the +real name of that author is already correct. Example 2: Your repository contains commits from the following authors: @@ -62,7 +61,7 @@ claus CTO ------------ -Then, you might want a `.mailmap` file looking like: +Then you might want a `.mailmap` file that looks like: ------------ Some Dude nick1 @@ -72,4 +71,4 @@ Santa Claus ------------ Use hash '#' for comments that are either on their own line, or after -the email address. \ No newline at end of file +the email address. From e5ac1217eb2639df1d39fdcd249a35d99e8a7a8e Mon Sep 17 00:00:00 2001 From: "David J. Mellor" Date: Mon, 16 Mar 2009 23:16:17 -0700 Subject: [PATCH 06/13] Documentation: minor grammatical fixes in git-branch.txt. Signed-off-by: David J. Mellor Signed-off-by: Junio C Hamano --- Documentation/git-branch.txt | 50 ++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt index 6103d62fe3..7f7b781f24 100644 --- a/Documentation/git-branch.txt +++ b/Documentation/git-branch.txt @@ -18,19 +18,19 @@ SYNOPSIS DESCRIPTION ----------- -With no arguments, existing branches are listed, the current branch will +With no arguments, existing branches are listed and the current branch will be highlighted with an asterisk. Option `-r` causes the remote-tracking branches to be listed, and option `-a` shows both. -With `--contains`, shows only the branches that contains the named commit -(in other words, the branches whose tip commits are descendant of the +With `--contains`, shows only the branches that contain the named commit +(in other words, the branches whose tip commits are descendants of the named commit). With `--merged`, only branches merged into the named commit (i.e. the branches whose tip commits are reachable from the named commit) will be listed. With `--no-merged` only branches not merged into -the named commit will be listed. Missing argument defaults to -'HEAD' (i.e. the tip of the current branch). +the named commit will be listed. If the argument is missing it +defaults to 'HEAD' (i.e. the tip of the current branch). -In its second form, a new branch named will be created. +In the command's second form, a new branch named will be created. It will start out with a head equal to the one given as . If no is given, the branch will be created with a head equal to that of the currently checked out branch. @@ -57,9 +57,9 @@ has a reflog then the reflog will also be deleted. Use -r together with -d to delete remote-tracking branches. Note, that it only makes sense to delete remote-tracking branches if they no longer exist -in remote repository or if 'git-fetch' was configured not to fetch -them again. See also 'prune' subcommand of linkgit:git-remote[1] for way to -clean up all obsolete remote-tracking branches. +in the remote repository or if 'git-fetch' was configured not to fetch +them again. See also the 'prune' subcommand of linkgit:git-remote[1] for a +way to clean up all obsolete remote-tracking branches. OPTIONS @@ -83,7 +83,7 @@ OPTIONS Move/rename a branch and the corresponding reflog. -M:: - Move/rename a branch even if the new branchname already exists. + Move/rename a branch even if the new branch name already exists. --color:: Color branches to highlight current, local, and remote branches. @@ -103,17 +103,17 @@ OPTIONS Show sha1 and commit subject line for each head. --abbrev=:: - Alter minimum display length for sha1 in output listing, - default value is 7. + Alter the sha1's minimum display length in the output listing. + The default value is 7. --no-abbrev:: - Display the full sha1s in output listing rather than abbreviating them. + Display the full sha1s in the output listing rather than abbreviating them. --track:: - When creating a new branch, set up configuration so that 'git-pull' + When creating a new branch, set up the configuration so that 'git-pull' will automatically retrieve data from the start point, which must be a branch. Use this if you always pull from the same upstream branch - into the new branch, and if you don't want to use "git pull + into the new branch, and if you do not want to use "git pull " explicitly. This behavior is the default when the start point is a remote branch. Set the branch.autosetupmerge configuration variable to `false` if you want @@ -149,13 +149,13 @@ OPTIONS :: The new name for an existing branch. The same restrictions as for - applies. + apply. Examples -------- -Start development off of a known tag:: +Start development from a known tag:: + ------------ $ git clone git://git.kernel.org/pub/scm/.../linux-2.6 my2.6 @@ -167,7 +167,7 @@ $ git checkout my2.6.14 <1> This step and the next one could be combined into a single step with "checkout -b my2.6.14 v2.6.14". -Delete unneeded branch:: +Delete an unneeded branch:: + ------------ $ git clone git://git.kernel.org/.../git.git my.git @@ -176,21 +176,21 @@ $ git branch -d -r origin/todo origin/html origin/man <1> $ git branch -D test <2> ------------ + -<1> Delete remote-tracking branches "todo", "html", "man". Next 'fetch' or -'pull' will create them again unless you configure them not to. See -linkgit:git-fetch[1]. -<2> Delete "test" branch even if the "master" branch (or whichever branch is -currently checked out) does not have all commits from test branch. +<1> Delete the remote-tracking branches "todo", "html" and "man". The next +'fetch' or 'pull' will create them again unless you configure them not to. +See linkgit:git-fetch[1]. +<2> Delete the "test" branch even if the "master" branch (or whichever branch +is currently checked out) does not have all commits from the test branch. Notes ----- -If you are creating a branch that you want to immediately checkout, it's +If you are creating a branch that you want to checkout immediately, it is easier to use the git checkout command with its `-b` option to create a branch and check it out with a single command. -The options `--contains`, `--merged` and `--no-merged` serves three related +The options `--contains`, `--merged` and `--no-merged` serve three related but different purposes: - `--contains ` is used to find all branches which will need From ee9cf14d25267aaed4b1533f92e9e5e74d5a4383 Mon Sep 17 00:00:00 2001 From: "David J. Mellor" Date: Thu, 19 Mar 2009 00:00:12 -0700 Subject: [PATCH 07/13] Documentation: reworded the "Description" section of git-bisect.txt. Added fixes missing from 2364259. Signed-off-by: David J. Mellor Signed-off-by: Junio C Hamano --- Documentation/git-bisect.txt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt index ef82bb8585..9b4d9ce99c 100644 --- a/Documentation/git-bisect.txt +++ b/Documentation/git-bisect.txt @@ -114,21 +114,22 @@ $ git bisect view --stat Bisect log and bisect replay ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The good/bad input is logged, and: +After having marked revisions as good or bad, then: ------------ $ git bisect log ------------ -shows what you have done so far. You can truncate its output somewhere -and save it in a file, and run: +shows what you have done so far. If you discover that you made a mistake +in specifying the status of a revision, you can save the output of this +command to a file, edit it to remove the incorrect entries, and then issue +the following commands to return to a corrected state: ------------ +$ git bisect reset $ git bisect replay that-file ------------ -if you find later that you made a mistake specifying revisions as good/bad. - Avoiding testing a commit ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -141,7 +142,7 @@ want to find a nearby commit and try that instead. For example: ------------ -$ git bisect good/bad # previous round was good/bad. +$ git bisect good/bad # previous round was good or bad. Bisecting: 337 revisions left to test after this $ git bisect visualize # oops, that is uninteresting. $ git reset --hard HEAD~3 # try 3 revisions before what @@ -149,7 +150,7 @@ $ git reset --hard HEAD~3 # try 3 revisions before what ------------ Then compile and test the chosen revision. Afterwards the revision -is marked as good/bad in the usual manner. +is marked as good or bad in the usual manner. Bisect skip ~~~~~~~~~~~~ @@ -240,7 +241,7 @@ before compiling, run the real test, and afterwards decide if the revision (possibly with the needed patch) passed the test and then rewind the tree to the pristine state. Finally the script should exit with the status of the real test to let the "git bisect run" command loop -to determine the eventual outcome of the bisect session. +determine the eventual outcome of the bisect session. EXAMPLES -------- From 4306bcb4e14ab708f0083bcf0339fa77a4005c05 Mon Sep 17 00:00:00 2001 From: "David J. Mellor" Date: Thu, 19 Mar 2009 20:35:34 -0700 Subject: [PATCH 08/13] Documentation: reword example text in git-bisect.txt. Avoid splitting sentences across examples of command usage. Signed-off-by: David J. Mellor Signed-off-by: Junio C Hamano --- Documentation/git-bisect.txt | 44 ++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt index 9b4d9ce99c..ec9594eda3 100644 --- a/Documentation/git-bisect.txt +++ b/Documentation/git-bisect.txt @@ -50,28 +50,29 @@ $ git bisect good v2.6.13-rc2 # v2.6.13-rc2 was the last version ------------------------------------------------ When you have specified at least one bad and one good version, the -command bisects the revision tree and outputs something similar to: +command bisects the revision tree and outputs something similar to +the following: ------------------------------------------------ Bisecting: 675 revisions left to test after this ------------------------------------------------ -and then checks out the state in the middle. You would now compile -that kernel and boot it. If the booted kernel works correctly, you -would then issue the following command: +The state in the middle of the set of revisions is then checked out. +You would now compile that kernel and boot it. If the booted kernel +works correctly, you would then issue the following command: ------------------------------------------------ $ git bisect good # this one is good ------------------------------------------------ -which would then output something similar to: +The output of this command would be something similar to the following: ------------------------------------------------ Bisecting: 337 revisions left to test after this ------------------------------------------------ -and you continue along, compiling that one, testing it, and depending -on whether it is good or bad issuing the command "git bisect good" +You keep repeating this process, compiling the tree, testing it, and +depending on whether it is good or bad issuing the command "git bisect good" or "git bisect bad" to ask for the next bisection. Eventually there will be no more revisions left to bisect, and you @@ -81,7 +82,7 @@ Bisect reset ~~~~~~~~~~~~ To return to the original head after a bisect session, you issue the -command: +following command: ------------------------------------------------ $ git bisect reset @@ -94,14 +95,14 @@ the bisection state). Bisect visualize ~~~~~~~~~~~~~~~~ -During the bisection process, you issue the command: +To see the currently remaining suspects in 'gitk', the following command +is issued during the bisection process: ------------ $ git bisect visualize ------------ -to see the currently remaining suspects in 'gitk'. `view` may also -be used as a synonym for `visualize`. +`view` may also be used as a synonym for `visualize`. If the 'DISPLAY' environment variable is not set, 'git log' is used instead. You can also give command line options such as `-p` and @@ -114,16 +115,17 @@ $ git bisect view --stat Bisect log and bisect replay ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -After having marked revisions as good or bad, then: +After having marked revisions as good or bad, you issue the following +command to show what has been done so far: ------------ $ git bisect log ------------ -shows what you have done so far. If you discover that you made a mistake -in specifying the status of a revision, you can save the output of this -command to a file, edit it to remove the incorrect entries, and then issue -the following commands to return to a corrected state: +If you discover that you made a mistake in specifying the status of a +revision, you can save the output of this command to a file, edit it to +remove the incorrect entries, and then issue the following commands to +return to a corrected state: ------------ $ git bisect reset @@ -173,8 +175,8 @@ using the "''..''" notation. For example: $ git bisect skip v2.5..v2.6 ------------ -would mean that no commit between `v2.5` excluded and `v2.6` included -can be tested. +The effect of this would be that no commit between `v2.5` excluded and +`v2.6` included could be tested. Note that if you also want to skip the first commit of the range you would issue the command: @@ -183,14 +185,16 @@ would issue the command: $ git bisect skip v2.5 v2.5..v2.6 ------------ -and the commit pointed to by `v2.5` would also be skipped. +This would cause the commits between `v2.5` included and `v2.6` included +to be skipped. + Cutting down bisection by giving more parameters to bisect start ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You can further cut down the number of trials, if you know what part of the tree is involved in the problem you are tracking down, by specifying -path parameters when issuing the `bisect start` command, like this: +path parameters when issuing the `bisect start` command: ------------ $ git bisect start -- arch/i386 include/asm-i386 From b60df87a6b39b3e9fc2fe81585a8bc55a502dcd3 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Sat, 21 Mar 2009 21:32:43 -0700 Subject: [PATCH 09/13] format-patch: --numbered-files and --stdout aren't mutually exclusive For example: git format-patch --numbered-files --stdout --attach HEAD~~ will create two messages with files 1 and 2 attached respectively. Without --attach/--inline but with --stdout, --numbered-files option can be simply ignored, because we are not creating any file ourselves. Signed-off-by: Stephen Boyd Signed-off-by: Junio C Hamano --- Documentation/git-format-patch.txt | 1 - builtin-log.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt index 11a7d77261..dc40f47169 100644 --- a/Documentation/git-format-patch.txt +++ b/Documentation/git-format-patch.txt @@ -96,7 +96,6 @@ include::diff-options.txt[] --numbered-files:: Output file names will be a simple number sequence without the default first line of the commit appended. - Mutually exclusive with the --stdout option. -k:: --keep-subject:: diff --git a/builtin-log.c b/builtin-log.c index 2ae39afccd..0f0adf2bab 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -917,8 +917,6 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) die ("-n and -k are mutually exclusive."); if (keep_subject && subject_prefix) die ("--subject-prefix and -k are mutually exclusive."); - if (numbered_files && use_stdout) - die ("--numbered-files and --stdout are mutually exclusive."); argc = setup_revisions(argc, argv, &rev, "HEAD"); if (argc > 1) From 7ad3c52e2dc8e81aafa615fb8b65ad99b6a62172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Mon, 16 Mar 2009 19:38:42 +0100 Subject: [PATCH 10/13] pickaxe: count regex matches only once When --pickaxe-regex is used, forward past the end of matches instead of advancing to the byte after their start. This way matches count only once, even if the regular expression matches their tail -- like in the fixed-string fork of the code. E.g.: /.*/ used to count the number of bytes instead of the number of lines. /aa/ resulted in a count of two in "aaa" instead of one. Also document the fact that regexec() needs a NUL-terminated string as its second argument by adding an assert(). Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- diffcore-pickaxe.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/diffcore-pickaxe.c b/diffcore-pickaxe.c index 574b3e8337..d0ef839700 100644 --- a/diffcore-pickaxe.c +++ b/diffcore-pickaxe.c @@ -25,10 +25,12 @@ static unsigned int contains(struct diff_filespec *one, regmatch_t regmatch; int flags = 0; + assert(data[sz] == '\0'); while (*data && !regexec(regexp, data, 1, ®match, flags)) { flags |= REG_NOTBOL; - data += regmatch.rm_so; - if (*data) data++; + data += regmatch.rm_eo; + if (*data && regmatch.rm_so == regmatch.rm_eo) + data++; cnt++; } From 67c176f549daf5530cabbb801de2b5feb0db82f4 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Tue, 17 Mar 2009 05:03:19 -0400 Subject: [PATCH 11/13] ls-files: require worktree when --deleted is given The code will end up calling lstat() to check whether the file still exists; obviously this doesn't work if we're not in the worktree. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- builtin-ls-files.c | 1 + 1 file changed, 1 insertion(+) diff --git a/builtin-ls-files.c b/builtin-ls-files.c index 9dec282fba..ca6f33d046 100644 --- a/builtin-ls-files.c +++ b/builtin-ls-files.c @@ -419,6 +419,7 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix) } if (!strcmp(arg, "-d") || !strcmp(arg, "--deleted")) { show_deleted = 1; + require_work_tree = 1; continue; } if (!strcmp(arg, "-m") || !strcmp(arg, "--modified")) { From 93467ee660ed1c145fe91ee8928220be6ef9a51c Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 21 Mar 2009 23:21:15 -0700 Subject: [PATCH 12/13] Update draft release notes to 1.6.2.2 Signed-off-by: Junio C Hamano --- Documentation/RelNotes-1.6.2.2.txt | 35 ++++++++++++++++++++++++++++++ RelNotes | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 Documentation/RelNotes-1.6.2.2.txt diff --git a/Documentation/RelNotes-1.6.2.2.txt b/Documentation/RelNotes-1.6.2.2.txt new file mode 100644 index 0000000000..28bfa5399b --- /dev/null +++ b/Documentation/RelNotes-1.6.2.2.txt @@ -0,0 +1,35 @@ +GIT v1.6.2.2 Release Notes +========================== + +Fixes since v1.6.2.1 +-------------------- + +* A longstanding confusing description of what --pickaxe option of + git-diff does has been clarified in the documentation. + +* "git diff --pickaxe-regexp" did not count overlapping matches + correctly. + +* "git-fetch" in a repository that was not cloned from anywhere said + it cannot find 'origin', which was hard to understand for new people. + +* "git-format-patch --numbered-files --stdout" did not have to die of + incompatible options; it now simply ignores --numbered-files as no files + are produced anyway. + +* "git-ls-files --deleted" did not work well with GIT_DIR&GIT_WORK_TREE. + +* "git-read-tree A B C..." without -m option has been broken for a long + time. + +* git-send-email ignored --in-reply-to when --no-thread was given. + +* 'git-submodule add' did not tolerate extra slashes and ./ in the path it + accepted from the command line; it now is more lenient. + + +--- +exec >/var/tmp/1 +O=v1.6.2.1-23-g67c176f +echo O=$(git describe maint) +git shortlog --no-merges $O..maint diff --git a/RelNotes b/RelNotes index cc85675c62..96e77da7c0 120000 --- a/RelNotes +++ b/RelNotes @@ -1 +1 @@ -Documentation/RelNotes-1.6.2.1.txt \ No newline at end of file +Documentation/RelNotes-1.6.2.2.txt \ No newline at end of file From 3e5970a41ec0809efb792357af546ffa96568f66 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Sun, 22 Mar 2009 02:15:13 -0700 Subject: [PATCH 13/13] everyday: use the dashless form of git-init The 'Everyday GIT' guide was using the old dashed form of git-init. Signed-off-by: David Aguilar Signed-off-by: Junio C Hamano --- Documentation/everyday.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/everyday.txt b/Documentation/everyday.txt index e598cdda45..9310b650d3 100644 --- a/Documentation/everyday.txt +++ b/Documentation/everyday.txt @@ -98,7 +98,7 @@ Use a tarball as a starting point for a new repository.:: ------------ $ tar zxf frotz.tar.gz $ cd frotz -$ git-init +$ git init $ git add . <1> $ git commit -m "import of frotz source tree." $ git tag v2.43 <2>