From 62cd033daa48f5fadda8921635a7073d3adc4a32 Mon Sep 17 00:00:00 2001 From: A Large Angry SCM Date: Mon, 29 Aug 2005 22:31:22 -0400 Subject: [PATCH] Documentation for git-daemon. Copy & paste source comments into documentation. Signed-off-by: (cherry picked from 5d0a4efeff62cfa363437f91308453b5b9fd8cf5 commit) --- Documentation/git-daemon.txt | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/Documentation/git-daemon.txt b/Documentation/git-daemon.txt index 5886c83ec..5fc45f215 100644 --- a/Documentation/git-daemon.txt +++ b/Documentation/git-daemon.txt @@ -3,26 +3,34 @@ git-daemon(1) NAME ---- -git-daemon - Some git command not yet documented. - +git-daemon - A really simple server for GIT repositories. SYNOPSIS -------- -'git-daemon' [ --option ] ... +'git-daemon' [--inetd | --port=n] DESCRIPTION ----------- -Does something not yet documented. +A really simple TCP git daemon that normally listens on port "DEFAULT_GIT_PORT" +aka 9418. It waits for a connection, and will just execute "git-upload-pack" +when it gets one. + +It's careful in that there's a magic request-line that gives the command and +what directory to upload, and it verifies that the directory is ok. +It verifies that the directory has the magic file "git-daemon-export-ok", and +it will refuse to export any git directory that hasn't explicitly been marked +for export this way. + +This is ideally suited for read-only updates, ie pulling from git repositories. OPTIONS ------- ---option:: - Some option not yet documented. - -...:: - Some argument not yet documented. +--inetd:: + Have the server run as an inetd service. +--port:: + Listen on an alternative port. Author ------ -- cgit v1.2.1 From 1efdd27f54e42746c23944cfe77e568673b2a0fa Mon Sep 17 00:00:00 2001 From: A Large Angry SCM Date: Mon, 29 Aug 2005 22:32:04 -0400 Subject: [PATCH] Documentation for git-clone-dumb-http. Copy & paste source comments into documentation. Signed-off-by: (cherry picked from f79528e5d05a64d68b8e09a18521950775e99ec1 commit) --- Documentation/git-clone-dumb-http.txt | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Documentation/git-clone-dumb-http.txt b/Documentation/git-clone-dumb-http.txt index 782484517..170464922 100644 --- a/Documentation/git-clone-dumb-http.txt +++ b/Documentation/git-clone-dumb-http.txt @@ -3,26 +3,24 @@ git-clone-dumb-http(1) NAME ---- -git-clone-dumb-http - Some git command not yet documented. - +git-clone-dumb-http - Client to clone a repository via HTTP. SYNOPSIS -------- -'git-clone-dumb-http' [ --option ] ... +'git-clone-dumb-http' DESCRIPTION ----------- -Does something not yet documented. - +Client to clone, via HTTP, a repository that has been prepared with +update-server-info. OPTIONS ------- ---option:: - Some option not yet documented. - -...:: - Some argument not yet documented. +:: + Remote repository to clone from. +:: + Directory to clone to. Author ------ -- cgit v1.2.1 From b5dca4bbd97dc43e34c1361a32c212298508102c Mon Sep 17 00:00:00 2001 From: A Large Angry SCM Date: Mon, 29 Aug 2005 22:33:14 -0400 Subject: [PATCH] Documentation for git-request-pull-script. Copy & paste source comments into documentation. Signed-off-by: (cherry picked from 10dce95490cb02f66b3a08984ccdee0a92b48236 commit) --- Documentation/git-request-pull-script.txt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Documentation/git-request-pull-script.txt b/Documentation/git-request-pull-script.txt index 891468ddb..1ebf72633 100644 --- a/Documentation/git-request-pull-script.txt +++ b/Documentation/git-request-pull-script.txt @@ -3,26 +3,28 @@ git-request-pull-script(1) NAME ---- -git-request-pull-script - Some git command not yet documented. - +git-request-pull-script - Generates a summary of pending changes. SYNOPSIS -------- -'git-request-pull-script' [ --option ] ... +'git-request-pull-script' [] DESCRIPTION ----------- -Does something not yet documented. +Summarizes the changes between two commits to the standard output, and includes +the given URL in the generated summary. OPTIONS ------- ---option:: - Some option not yet documented. +:: + Commit to start at. -...:: - Some argument not yet documented. +:: + URL to include in the summary. +:: + Commit to send at; defaults to HEAD. Author ------ -- cgit v1.2.1 From cf6de18aabf774dfce7efd9c59babfe9d909d433 Mon Sep 17 00:00:00 2001 From: A Large Angry SCM Date: Mon, 29 Aug 2005 22:34:07 -0400 Subject: [PATCH] Update Thunderbird specific hints. Setting the wraplength to zero keeps the bird from trimming WS. Signed-off-by: (cherry picked from 1d535d525d6a0ddddc3755065d721278bc5f0aff commit) --- Documentation/SubmittingPatches | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches index fd9881f26..26db5dd28 100644 --- a/Documentation/SubmittingPatches +++ b/Documentation/SubmittingPatches @@ -239,7 +239,7 @@ Thunderbird (A Large Angry SCM) Here are some hints on how to successfully submit patches inline using -Thunderbird. [*3*] +Thunderbird. This recipe appears to work with the current [*1*] Thunderbird from Suse. @@ -260,7 +260,7 @@ patch. [*2*] for the patch, use Tools->about:config to set the following to the indicated values: mailnews.send_plaintext_flowed => false - mailnews.wraplength => 999 + mailnews.wraplength => 0 4) Open a compose window and click the external editor icon. @@ -284,7 +284,3 @@ settings but I haven't tried, yet. mail.identity.default.compose_html => false mail.identity.id?.compose_html => false -*3* Even after following these hints, Thunderbird will still trim -trailing whitespace from each line. I currently have no work around for -for this issue. - -- cgit v1.2.1 From 5de36bfec9beb65f8d0328b367dcf0e7d74d30bb Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 29 Aug 2005 21:17:21 -0700 Subject: Fix compilation warnings. ... found by compiling them with gcc 2.95. Signed-off-by: Junio C Hamano --- commit.c | 2 +- diff.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commit.c b/commit.c index e51eda152..2f73cf3d9 100644 --- a/commit.c +++ b/commit.c @@ -357,7 +357,7 @@ static int get_one_line(const char *msg, unsigned long len) static int add_user_info(const char *what, enum cmit_fmt fmt, char *buf, const char *line) { char *date; - unsigned int namelen; + int namelen; unsigned long time; int tz, ret; diff --git a/diff.c b/diff.c index 9015c81d7..527cbf04a 100644 --- a/diff.c +++ b/diff.c @@ -704,7 +704,7 @@ static int parse_num(const char **cp_p) scale *= 10; num = num * 10 + ch - '0'; } - *cp++; + cp++; } *cp_p = cp; -- cgit v1.2.1 From 9fa4db544e2e4d6c931f6adabc5270daec041536 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 29 Aug 2005 21:19:04 -0700 Subject: Do not verify reverted/cherry-picked/rebased patches. The original committer may have used validation criteria that is less stricter than yours. You do not want to lose the changes even if they are done in substandard way from your 'commit -v' verifier's point of view. Signed-off-by: Junio C Hamano --- git-revert-script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-revert-script b/git-revert-script index dd5866ec9..82ed09380 100755 --- a/git-revert-script +++ b/git-revert-script @@ -158,7 +158,7 @@ echo >&2 "Finished one $me." case "$no_commit" in '') - git commit -F .msg + git-commit-script -n -F .msg rm -f .msg ;; esac -- cgit v1.2.1 From bc4af68a1a876a9eb6ff030b88b76a90fd09a9ea Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 29 Aug 2005 21:25:19 -0700 Subject: git commit: Allow editing on all occasions. Sometimes it may be handy to be able to edit messages that come from somewhere other than an existing commit. This makes 'git commit -F -e' to start editor with the initial log message contents taken from . Signed-off-by: Junio C Hamano --- git-commit-script | 3 +++ 1 file changed, 3 insertions(+) diff --git a/git-commit-script b/git-commit-script index 4987e3786..cd28dde64 100755 --- a/git-commit-script +++ b/git-commit-script @@ -64,6 +64,9 @@ do use_commit="$1" no_edit=t shift ;; + -e|--e|--ed|--edi|--edit) + no_edit= + shift ;; -s|--s|--si|--sig|--sign|--signo|--signof|--signoff) signoff=t shift ;; -- cgit v1.2.1 From 3459c2c433ac46eac596810d2ef2c3d4ef949852 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 29 Aug 2005 21:50:49 -0700 Subject: Add [HOWTO] revert/branch/rebase. Signed-off-by: Junio C Hamano --- Documentation/howto/revert-branch-rebase.txt | 199 +++++++++++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 Documentation/howto/revert-branch-rebase.txt diff --git a/Documentation/howto/revert-branch-rebase.txt b/Documentation/howto/revert-branch-rebase.txt new file mode 100644 index 000000000..1c9a36888 --- /dev/null +++ b/Documentation/howto/revert-branch-rebase.txt @@ -0,0 +1,199 @@ +From: Junio C Hamano +To: git@vger.kernel.org +Subject: [HOWTO] Reverting an existing commit +Abstract: In this article, JC gives a small real-life example of using + 'git revert' command, and using a temporary branch and tag for safety + and easier sanity checking. +Date: Mon, 29 Aug 2005 21:39:02 -0700 +Content-type: text/asciidoc +Message-ID: <7voe7g3uop.fsf@assigned-by-dhcp.cox.net> + +Reverting an existing commit +============================ + +One of the changes I pulled into the 'master' branch turns out to +break building GIT with GCC 2.95. While they were well intentioned +portability fixes, keeping things working with gcc-2.95 was also +important. Here is what I did to revert the change in the 'master' +branch and to adjust the 'pu' branch, using core GIT tools and +barebone Porcelain. + +First, prepare a throw-away branch in case I screw things up. + +------------------------------------------------ +$ git checkout -b revert-c99 master +------------------------------------------------ + +Now I am on the 'revert-c99' branch. Let's figure out which commit to +revert. I happen to know that the top of the 'master' branch is a +merge, and its second parent (i.e. foreign commit I merged from) has +the change I would want to undo. Further I happen to know that that +merge introduced 5 commits or so: + +------------------------------------------------ +$ git show-branch --more=4 master master^2 | head +! [master] Merge refs/heads/portable from http://www.cs.berkeley.... + ! [master^2] Replace C99 array initializers with code. +-- ++ [master] Merge refs/heads/portable from http://www.cs.berkeley.... +++ [master^2] Replace C99 array initializers with code. +++ [master^2~1] Replace unsetenv() and setenv() with older putenv(). +++ [master^2~2] Include sys/time.h in daemon.c. +++ [master^2~3] Fix ?: statements. +++ [master^2~4] Replace zero-length array decls with []. ++ [master~1] tutorial note about git branch +------------------------------------------------ + +The '--more=4' above means "after we reach the merge base of refs, +show until we display four more common commits". That last commit +would have been where the "portable" branch was forked from the main +git.git repository, so this would show everything on both branches +since then. I just limited the output to the first handful using +'head'. + +Now I know 'master^2~4' (pronounce it as "find the second parent of +the 'master', and then go four generations back following the first +parent") is the one I would want to revert. Since I also want to say +why I am reverting it, the '-n' flag is given to 'git revert'. This +prevents it from actually making a commit, and instead 'git revert' +leaves the commit log message it wanted to use in '.msg' file: + +------------------------------------------------ +$ git revert -n master^2~4 +$ cat .msg +Revert "Replace zero-length array decls with []." + +This reverts 6c5f9baa3bc0d63e141e0afc23110205379905a4 commit. +$ git diff HEAD ;# to make sure what we are reverting makes sense. +$ make CC=gcc-2.95 clean test ;# make sure it fixed the breakage. +$ make clean test ;# make sure it did not cause other breakage. +------------------------------------------------ + +The reverted change makes sense (from reading the 'diff' output), does +fix the problem (from 'make CC=gcc-2.95' test), and does not cause new +breakage (from the last 'make test'). I'm ready to commit: + +------------------------------------------------ +$ git commit -a -s ;# read .msg into the log, + # and explain why I am reverting. +------------------------------------------------ + +I could have screwed up in any of the above steps, but in the worst +case I could just have done 'git checkout master' to start over. +Fortunately I did not have to; what I have in the current branch +'revert-c99' is what I want. So merge that back into 'master': + +------------------------------------------------ +$ git checkout master +$ git resolve master revert-c99 fast ;# this should be a fast forward +Updating from 10d781b9caa4f71495c7b34963bef137216f86a8 to e3a693c... + cache.h | 8 ++++---- + commit.c | 2 +- + ls-files.c | 2 +- + receive-pack.c | 2 +- + server-info.c | 2 +- + 5 files changed, 8 insertions(+), 8 deletions(-) +------------------------------------------------ + +The 'fast' in the above 'git resolve' is not a magic. I knew this +'resolve' would result in a fast forward merge, and if not, there is +something very wrong (so I would do 'git reset' on the 'master' branch +and examine the situation). When a fast forward merge is done, the +message parameter to 'git resolve' is discarded, because no new commit +is created. You could have said 'junk' or 'nothing' there as well. + +There is no need to redo the test at this point. We fast forwarded +and we know 'master' matches 'revert-c99' exactly. In fact: + +------------------------------------------------ +$ git diff master..revert-c99 +------------------------------------------------ + +says nothing. + +Then we rebase the 'pu' branch as usual. + +------------------------------------------------ +$ git checkout pu +$ git tag pu-anchor pu +$ git rebase master +* Applying: Redo "revert" using three-way merge machinery. +First trying simple merge strategy to cherry-pick. +Finished one cherry-pick. +* Applying: Remove git-apply-patch-script. +First trying simple merge strategy to cherry-pick. +Simple cherry-pick fails; trying Automatic cherry-pick. +Removing Documentation/git-apply-patch-script.txt +Removing git-apply-patch-script +Finished one cherry-pick. +* Applying: Document "git cherry-pick" and "git revert" +First trying simple merge strategy to cherry-pick. +Finished one cherry-pick. +* Applying: mailinfo and applymbox updates +First trying simple merge strategy to cherry-pick. +Finished one cherry-pick. +* Applying: Show commits in topo order and name all commits. +First trying simple merge strategy to cherry-pick. +Finished one cherry-pick. +* Applying: More documentation updates. +First trying simple merge strategy to cherry-pick. +Finished one cherry-pick. +------------------------------------------------ + +The temporary tag 'pu-anchor' is me just being careful, in case 'git +rebase' screws up. After this, I can do these for sanity check: + +------------------------------------------------ +$ git diff pu-anchor..pu ;# make sure we got the master fix. +$ make CC=gcc-2.95 clean test ;# make sure it fixed the breakage. +$ make clean test ;# make sure it did not cause other breakage. +------------------------------------------------ + +Everything is in the good order. I do not need the temporary branch +nor tag anymore, so remove them: + +------------------------------------------------ +$ rm -f .git/refs/tags/pu-anchor .git/refs/heads/revert-c99 +------------------------------------------------ + +It was an emergency fix, so we might as well merge it into the +'release candidate' branch, although I expect the next release would +be some days off: + +------------------------------------------------ +$ git checkout rc +$ git pull . master +Packing 0 objects +Unpacking 0 objects + +* committish: e3a693c... refs/heads/master from . +Trying to merge e3a693c... into 8c1f5f0... using 10d781b... +Committed merge 7fb9b7262a1d1e0a47bbfdcbbcf50ce0635d3f8f + cache.h | 8 ++++---- + commit.c | 2 +- + ls-files.c | 2 +- + receive-pack.c | 2 +- + server-info.c | 2 +- + 5 files changed, 8 insertions(+), 8 deletions(-) +------------------------------------------------ + +And the final repository status looks like this: + +------------------------------------------------ +$ git show-branch --more=1 master pu rc +! [master] Revert "Replace zero-length array decls with []." + ! [pu] git-repack-script: Add option to repack all objects. + * [rc] Merge refs/heads/master from . +--- + + [pu] git-repack-script: Add option to repack all objects. + + [pu~1] More documentation updates. + + [pu~2] Show commits in topo order and name all commits. + + [pu~3] mailinfo and applymbox updates + + [pu~4] Document "git cherry-pick" and "git revert" + + [pu~5] Remove git-apply-patch-script. + + [pu~6] Redo "revert" using three-way merge machinery. + + [rc] Merge refs/heads/master from . ++++ [master] Revert "Replace zero-length array decls with []." + + [rc~1] Merge refs/heads/master from . ++++ [master~1] Merge refs/heads/portable from http://www.cs.berkeley.... +------------------------------------------------ -- cgit v1.2.1