Merge branch 'gl/cleanup'
authorJunio C Hamano <junkio@cox.net>
Sat, 26 Aug 2006 08:06:22 +0000 (01:06 -0700)
committerJunio C Hamano <junkio@cox.net>
Sat, 26 Aug 2006 08:06:22 +0000 (01:06 -0700)
* gl/cleanup:
Convert memset(hash,0,20) to hashclr(hash).
Convert memcpy(a,b,20) to hashcpy(a,b).

22 files changed:
Documentation/git-apply.txt
Documentation/git-blame.txt
Documentation/git-ls-remote.txt
Documentation/git-svn.txt
Documentation/git-update-index.txt
Documentation/git.txt
Documentation/gitk.txt
builtin-apply.c
builtin-grep.c
builtin-mv.c
builtin-push.c
builtin-tar-tree.c
builtin-update-index.c
cache.h
contrib/gitview/gitview.txt
date.c
describe.c
environment.c
git-svn.perl
git.c
gitweb/gitweb.perl
http-push.c
index 2ff74949a73aa8670750105a7d292206877477c7..20e12ceda002d929ffc7ee13b77d0e23c7e91356 100644 (file)
@@ -10,9 +10,10 @@ SYNOPSIS
 --------
 [verse]
 'git-apply' [--stat] [--numstat] [--summary] [--check] [--index] [--apply]
-         [--no-add] [--index-info] [--allow-binary-replacement] [-z] [-pNUM]
-         [-CNUM] [--whitespace=<nowarn|warn|error|error-all|strip>]
-         [<patch>...]
+         [--no-add] [--index-info] [--allow-binary-replacement | --binary]
+         [-R | --reverse] [--reject] [-z] [-pNUM] [-CNUM] [--inaccurate-eof]
+         [--whitespace=<nowarn|warn|error|error-all|strip>] [--exclude=PATH]
+         [--cached] [--verbose] [<patch>...]
 
 DESCRIPTION
 -----------
@@ -55,6 +56,11 @@ OPTIONS
        up-to-date, it is flagged as an error.  This flag also
        causes the index file to be updated.
 
+--cached::
+       Apply a patch without touching the working tree. Instead, take the
+       cached data, apply the patch, and store the result in the index,
+       without using the working tree. This implies '--index'.
+
 --index-info::
        Newer git-diff output has embedded 'index information'
        for each blob to help identify the original version that
@@ -62,6 +68,16 @@ OPTIONS
        the original version of the blob is available locally,
        outputs information about them to the standard output.
 
+-R, --reverse::
+       Apply the patch in reverse.
+
+--reject::
+       For atomicity, gitlink:git-apply[1] by default fails the whole patch and
+       does not touch the working tree when some of the hunks
+       do not apply.  This option makes it apply
+       the parts of the patch that are applicable, and send the
+       rejected hunks to the standard output of the command.
+
 -z::
        When showing the index information, do not munge paths,
        but use NUL terminated machine readable format.  Without
@@ -80,8 +96,8 @@ OPTIONS
        ever ignored.
 
 --apply::
-       If you use any of the options marked ``Turns off
-       "apply"'' above, git-apply reads and outputs the
+       If you use any of the options marked "Turns off
+       'apply'" above, gitlink:git-apply[1] reads and outputs the
        information you asked without actually applying the
        patch.  Give this flag after those flags to also apply
        the patch.
@@ -93,7 +109,7 @@ OPTIONS
        the result with this option, which would apply the
        deletion part but not addition part.
 
---allow-binary-replacement::
+--allow-binary-replacement, --binary::
        When applying a patch, which is a git-enhanced patch
        that was prepared to record the pre- and post-image object
        name in full, and the path being patched exactly matches
@@ -104,13 +120,18 @@ OPTIONS
        result.  This allows binary files to be patched in a
        very limited way.
 
+--exclude=<path-pattern>::
+       Don't apply changes to files matching the given path pattern. This can
+       be useful when importing patchsets, where you want to exclude certain
+       files or directories.
+
 --whitespace=<option>::
        When applying a patch, detect a new or modified line
        that ends with trailing whitespaces (this includes a
        line that solely consists of whitespaces).  By default,
        the command outputs warning messages and applies the
        patch.
-       When `git-apply` is used for statistics and not applying a
+       When gitlink:git-apply[1] is used for statistics and not applying a
        patch, it defaults to `nowarn`.
        You can use different `<option>` to control this
        behavior:
@@ -124,6 +145,17 @@ OPTIONS
 * `strip` outputs warnings for a few such errors, strips out the
   trailing whitespaces and applies the patch.
 
+--inacurate-eof::
+       Under certain circumstances, some versions of diff do not correctly
+       detect a missing new-line at the end of the file. As a result, patches
+       created by such diff programs do not record incomplete lines
+       correctly. This option adds support for applying such patches by
+       working around this bug.
+
+--verbose::
+       Report progress to stderr. By default, only a message about the
+       current patch being applied will be printed. This option will cause
+       additional information to be reported.
 
 Configuration
 -------------
index bfed945914c5de74d6f46e51ee8fbe459e4d8420..e1f89444a95618a1e520940a79389c854cf9d576 100644 (file)
@@ -3,21 +3,38 @@ git-blame(1)
 
 NAME
 ----
-git-blame - Blame file lines on commits
+git-blame - Show what revision and author last modified each line of a file
 
 SYNOPSIS
 --------
-git-blame file [options] file [revision]
+'git-blame' [-c] [-l] [-t] [-S <revs-file>] [--] <file> [<rev>]
 
 DESCRIPTION
 -----------
-Annotates each line in the given file with information from the commit
-which introduced the line. Start annotation from the given revision.
+
+Annotates each line in the given file with information from the revision which
+last modified the line. Optionally, start annotating from the given revision.
+
+This report doesn't tell you anything about lines which have been deleted or
+replaced; you need to use a tool such as gitlink:git-diff[1] or the "pickaxe"
+interface briefly mentioned in the following paragraph.
+
+Apart from supporting file annotation, git also supports searching the
+development history for when a code snippet occured in a change. This makes it
+possible to track when a code snippet was added to a file, moved or copied
+between files, and eventually deleted or replaced. It works by searching for
+a text string in the diff. A small example:
+
+-----------------------------------------------------------------------------
+$ git log --pretty=oneline -S'blame_usage'
+5040f17eba15504bad66b14a645bddd9b015ebb7 blame -S <ancestry-file>
+ea4c7f9bf69e781dd0cd88d2bccb2bf5cc15c9a7 git-blame: Make the output
+-----------------------------------------------------------------------------
 
 OPTIONS
 -------
 -c, --compatibility::
-       Use the same output mode as git-annotate (Default: off).
+       Use the same output mode as gitlink:git-annotate[1] (Default: off).
 
 -l, --long::
        Show long rev (Default: off).
@@ -26,7 +43,7 @@ OPTIONS
        Show raw timestamp (Default: off).
 
 -S, --rev-file <revs-file>::
-       Use revs from revs-file instead of calling git-rev-list.
+       Use revs from revs-file instead of calling gitlink:git-rev-list[1].
 
 -h, --help::
        Show help message.
index ae4c1a250e835bd39ee291088ba74c3c57604ac9..c8a4c5a4d9d2bead8686f1b582e985531a7f3591 100644 (file)
@@ -3,16 +3,19 @@ git-ls-remote(1)
 
 NAME
 ----
-git-ls-remote - Look at references other repository has
+git-ls-remote - List references in a remote repository
 
 
 SYNOPSIS
 --------
-'git-ls-remote' [--heads] [--tags] <repository> <refs>...
+[verse]
+'git-ls-remote' [--heads] [--tags]  [-u <exec> | --upload-pack <exec>]
+             <repository> <refs>...
 
 DESCRIPTION
 -----------
-Displays the references other repository has.
+Displays references available in a remote repository along with the associated
+commit IDs.
 
 
 OPTIONS
@@ -23,9 +26,16 @@ OPTIONS
        both, references stored in refs/heads and refs/tags are
        displayed.
 
+-u <exec>, --upload-pack=<exec>::
+       Specify the full path of gitlink:git-upload-pack[1] on the remote
+       host. This allows listing references from repositories accessed via
+       SSH and where the SSH deamon does not use the PATH configured by the
+       user. Also see the '--exec' option for gitlink:git-peek-remote[1].
+
 <repository>::
        Location of the repository.  The shorthand defined in
-       $GIT_DIR/branches/ can be used.
+       $GIT_DIR/branches/ can be used. Use "." (dot) to list references in
+       the local repository.
 
 <refs>...::
        When unspecified, all references, after filtering done
index 7d868098448c7cc6712988c7bb1df541aedf6824..b7b63f7136a01d6f3383346c292e5c8aceb8ced4 100644 (file)
@@ -12,10 +12,8 @@ SYNOPSIS
 DESCRIPTION
 -----------
 git-svn is a simple conduit for changesets between a single Subversion
-branch and git.
-
-git-svn is not to be confused with git-svnimport.  The were designed
-with very different goals in mind.
+branch and git. It is not to be confused with gitlink:git-svnimport[1].
+They were designed with very different goals in mind.
 
 git-svn is designed for an individual developer who wants a
 bidirectional flow of changesets between a single branch in Subversion
@@ -34,26 +32,38 @@ git-svnimport is designed for.
 
 COMMANDS
 --------
-init::
+--
+
+'init'::
        Creates an empty git repository with additional metadata
        directories for git-svn.  The Subversion URL must be specified
        as a command-line argument.
 
-fetch::
-       Fetch unfetched revisions from the Subversion URL we are
-       tracking.  refs/remotes/git-svn will be updated to the
-       latest revision.
+'fetch'::
+
+Fetch unfetched revisions from the Subversion URL we are
+tracking.  refs/remotes/git-svn will be updated to the
+latest revision.
+
+Note: You should never attempt to modify the remotes/git-svn
+branch outside of git-svn.  Instead, create a branch from
+remotes/git-svn and work on that branch.  Use the 'commit'
+command (see below) to write git commits back to
+remotes/git-svn.
 
-       Note: You should never attempt to modify the remotes/git-svn
-       branch outside of git-svn.  Instead, create a branch from
-       remotes/git-svn and work on that branch.  Use the 'commit'
-       command (see below) to write git commits back to
-       remotes/git-svn.
+See '<<fetch-args,Additional Fetch Arguments>>' if you are interested in
+manually joining branches on commit.
 
-       See 'Additional Fetch Arguments' if you are interested in
-       manually joining branches on commit.
+'dcommit'::
+       Commit all diffs from the current HEAD directly to the SVN
+       repository, and then rebase or reset (depending on whether or
+       not there is a diff between SVN and HEAD).  It is recommended
+       that you run git-svn fetch and rebase (not pull) your commits
+       against the latest changes in the SVN repository.
+       This is advantageous over 'commit' (below) because it produces
+       cleaner, more linear history.
 
-commit::
+'commit'::
        Commit specified commit or tree objects to SVN.  This relies on
        your imported fetch data being up-to-date.  This makes
        absolutely no attempts to do patching when committing to SVN, it
@@ -61,9 +71,9 @@ commit::
        commit.  All merging is assumed to have taken place
        independently of git-svn functions.
 
-rebuild::
+'rebuild'::
        Not a part of daily usage, but this is a useful command if
-       you've just cloned a repository (using git-clone) that was
+       you've just cloned a repository (using gitlink:git-clone[1]) that was
        tracked with git-svn.  Unfortunately, git-clone does not clone
        git-svn metadata and the svn working tree that git-svn uses for
        its operations.  This rebuilds the metadata so git-svn can
@@ -71,130 +81,170 @@ rebuild::
        specified at the command-line if the directory/repository you're
        tracking has moved or changed protocols.
 
-show-ignore::
+'show-ignore'::
        Recursively finds and lists the svn:ignore property on
        directories.  The output is suitable for appending to
        the $GIT_DIR/info/exclude file.
 
+--
+
 OPTIONS
 -------
+--
+
 -r <ARG>::
 --revision <ARG>::
-       Only used with the 'fetch' command.
 
-       Takes any valid -r<argument> svn would accept and passes it
-       directly to svn. -r<ARG1>:<ARG2> ranges and "{" DATE "}" syntax
-       is also supported.  This is passed directly to svn, see svn
-       documentation for more details.
+Only used with the 'fetch' command.
+
+Takes any valid -r<argument> svn would accept and passes it
+directly to svn. -r<ARG1>:<ARG2> ranges and "{" DATE "}" syntax
+is also supported.  This is passed directly to svn, see svn
+documentation for more details.
 
-       This can allow you to make partial mirrors when running fetch.
+This can allow you to make partial mirrors when running fetch.
 
 -::
 --stdin::
-       Only used with the 'commit' command.
 
-       Read a list of commits from stdin and commit them in reverse
-       order.  Only the leading sha1 is read from each line, so
-       git-rev-list --pretty=oneline output can be used.
+Only used with the 'commit' command.
+
+Read a list of commits from stdin and commit them in reverse
+order.  Only the leading sha1 is read from each line, so
+git-rev-list --pretty=oneline output can be used.
 
 --rmdir::
-       Only used with the 'commit' command.
 
-       Remove directories from the SVN tree if there are no files left
-       behind.  SVN can version empty directories, and they are not
-       removed by default if there are no files left in them.  git
-       cannot version empty directories.  Enabling this flag will make
-       the commit to SVN act like git.
+Only used with the 'commit' command.
+
+Remove directories from the SVN tree if there are no files left
+behind.  SVN can version empty directories, and they are not
+removed by default if there are no files left in them.  git
+cannot version empty directories.  Enabling this flag will make
+the commit to SVN act like git.
 
-       repo-config key: svn.rmdir
+repo-config key: svn.rmdir
 
 -e::
 --edit::
-       Only used with the 'commit' command.
 
-       Edit the commit message before committing to SVN.  This is off by
-       default for objects that are commits, and forced on when committing
-       tree objects.
+Only used with the 'commit' command.
 
-       repo-config key: svn.edit
+Edit the commit message before committing to SVN.  This is off by
+default for objects that are commits, and forced on when committing
+tree objects.
+
+repo-config key: svn.edit
 
 -l<num>::
 --find-copies-harder::
-       Both of these are only used with the 'commit' command.
 
-       They are both passed directly to git-diff-tree see
-       git-diff-tree(1) for more information.
+Both of these are only used with the 'commit' command.
+
+They are both passed directly to git-diff-tree see
+gitlink:git-diff-tree[1] for more information.
 
-       repo-config key: svn.l
-       repo-config key: svn.findcopiesharder
+[verse]
+repo-config key: svn.l
+repo-config key: svn.findcopiesharder
 
 -A<filename>::
 --authors-file=<filename>::
 
-       Syntax is compatible with the files used by git-svnimport and
-       git-cvsimport:
+Syntax is compatible with the files used by git-svnimport and
+git-cvsimport:
 
 ------------------------------------------------------------------------
-loginname = Joe User <user@example.com>
+       loginname = Joe User <user@example.com>
 ------------------------------------------------------------------------
 
-       If this option is specified and git-svn encounters an SVN
-       committer name that does not exist in the authors-file, git-svn
-       will abort operation. The user will then have to add the
-       appropriate entry.  Re-running the previous git-svn command
-       after the authors-file is modified should continue operation.
+If this option is specified and git-svn encounters an SVN
+committer name that does not exist in the authors-file, git-svn
+will abort operation. The user will then have to add the
+appropriate entry.  Re-running the previous git-svn command
+after the authors-file is modified should continue operation.
+
+repo-config key: svn.authors-file
+
+-m::
+--merge::
+-s<strategy>::
+--strategy=<strategy>::
+
+These are only used with the 'dcommit' command.
 
-       repo-config key: svn.authors-file
+Passed directly to git-rebase when using 'dcommit' if a
+'git-reset' cannot be used (see dcommit).
+
+-n::
+--dry-run::
+
+This is only used with the 'dcommit' command.
+
+Print out the series of git arguments that would show
+which diffs would be committed to SVN.
+
+--
 
 ADVANCED OPTIONS
 ----------------
+--
+
 -b<refname>::
 --branch <refname>::
-       Used with 'fetch' or 'commit'.
+Used with 'fetch' or 'commit'.
 
-       This can be used to join arbitrary git branches to remotes/git-svn
-       on new commits where the tree object is equivalent.
+This can be used to join arbitrary git branches to remotes/git-svn
+on new commits where the tree object is equivalent.
 
-       When used with different GIT_SVN_ID values, tags and branches in
-       SVN can be tracked this way, as can some merges where the heads
-       end up having completely equivalent content.  This can even be
-       used to track branches across multiple SVN _repositories_.
+When used with different GIT_SVN_ID values, tags and branches in
+SVN can be tracked this way, as can some merges where the heads
+end up having completely equivalent content.  This can even be
+used to track branches across multiple SVN _repositories_.
 
-       This option may be specified multiple times, once for each
-       branch.
+This option may be specified multiple times, once for each
+branch.
 
-       repo-config key: svn.branch
+repo-config key: svn.branch
 
 -i<GIT_SVN_ID>::
 --id <GIT_SVN_ID>::
-       This sets GIT_SVN_ID (instead of using the environment).  See
-       the section on "Tracking Multiple Repositories or Branches" for
-       more information on using GIT_SVN_ID.
+
+This sets GIT_SVN_ID (instead of using the environment).  See the
+section on
+'<<tracking-multiple-repos,Tracking Multiple Repositories or Branches>>'
+for more information on using GIT_SVN_ID.
+
+--
 
 COMPATIBILITY OPTIONS
 ---------------------
+--
+
 --upgrade::
-       Only used with the 'rebuild' command.
+Only used with the 'rebuild' command.
 
-       Run this if you used an old version of git-svn that used
-       "git-svn-HEAD" instead of "remotes/git-svn" as the branch
-       for tracking the remote.
+Run this if you used an old version of git-svn that used
+"git-svn-HEAD" instead of "remotes/git-svn" as the branch
+for tracking the remote.
 
 --no-ignore-externals::
-       Only used with the 'fetch' and 'rebuild' command.
+Only used with the 'fetch' and 'rebuild' command.
+
+By default, git-svn passes --ignore-externals to svn to avoid
+fetching svn:external trees into git.  Pass this flag to enable
+externals tracking directly via git.
 
-       By default, git-svn passes --ignore-externals to svn to avoid
-       fetching svn:external trees into git.  Pass this flag to enable
-       externals tracking directly via git.
+Versions of svn that do not support --ignore-externals are
+automatically detected and this flag will be automatically
+enabled for them.
 
-       Versions of svn that do not support --ignore-externals are
-       automatically detected and this flag will be automatically
-       enabled for them.
+Otherwise, do not enable this flag unless you know what you're
+doing.
 
-       Otherwise, do not enable this flag unless you know what you're
-       doing.
+repo-config key: svn.noignoreexternals
 
-       repo-config key: svn.noignoreexternals
+--
 
 Basic Examples
 ~~~~~~~~~~~~~~
@@ -212,12 +262,26 @@ Tracking and contributing to an Subversion managed-project:
        git-svn commit <tree-ish> [<tree-ish_2> ...]
 # Commit all the git commits from my-branch that don't exist in SVN:
        git-svn commit remotes/git-svn..my-branch
-# Something is committed to SVN, pull the latest into your branch:
-       git-svn fetch && git pull . remotes/git-svn
+# Something is committed to SVN, rebase the latest into your branch:
+       git-svn fetch && git rebase remotes/git-svn
 # Append svn:ignore settings to the default git exclude file:
        git-svn show-ignore >> .git/info/exclude
 ------------------------------------------------------------------------
 
+REBASE VS. PULL
+---------------
+
+Originally, git-svn recommended that the remotes/git-svn branch be
+pulled from.  This is because the author favored 'git-svn commit B'
+to commit a single head rather than the 'git-svn commit A..B' notation
+to commit multiple commits.
+
+If you use 'git-svn commit A..B' to commit several diffs and you do not
+have the latest remotes/git-svn merged into my-branch, you should use
+'git rebase' to update your work branch instead of 'git pull'.  'pull'
+can cause non-linear history to be flattened when committing into SVN,
+which can lead to merge commits reversing previous commits in SVN.
+
 DESIGN PHILOSOPHY
 -----------------
 Merge tracking in Subversion is lacking and doing branched development
@@ -226,6 +290,7 @@ any automated merge/branch tracking on the Subversion side and leaves it
 entirely up to the user on the git side.  It's simply not worth it to do
 a useful translation when the original signal is weak.
 
+[[tracking-multiple-repos]]
 TRACKING MULTIPLE REPOSITORIES OR BRANCHES
 ------------------------------------------
 This is for advanced users, most users should ignore this section.
@@ -241,6 +306,7 @@ invocation.  The interface branch will be remotes/$GIT_SVN_ID, instead of
 remotes/git-svn.  Any remotes/$GIT_SVN_ID branch should never be modified
 by the user outside of git-svn commands.
 
+[[fetch-args]]
 ADDITIONAL FETCH ARGUMENTS
 --------------------------
 This is for advanced users, most users should ignore this section.
@@ -251,11 +317,15 @@ optionally be specified in the form of sha1 hex sums at the
 command-line.  Unfetched SVN revisions may also be tied to particular
 git commits with the following syntax:
 
+------------------------------------------------
        svn_revision_number=git_commit_sha1
+------------------------------------------------
 
-This allows you to tie unfetched SVN revision 375 to your current HEAD::
+This allows you to tie unfetched SVN revision 375 to your current HEAD:
 
-       `git-svn fetch 375=$(git-rev-parse HEAD)`
+------------------------------------------------
+       git-svn fetch 375=$(git-rev-parse HEAD)
+------------------------------------------------
 
 Advanced Example: Tracking a Reorganized Repository
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -310,6 +380,10 @@ the possible corner cases (git doesn't do it, either).  Renamed and
 copied files are fully supported if they're similar enough for git to
 detect them.
 
+SEE ALSO
+--------
+gitlink:git-rebase[1]
+
 Author
 ------
 Written by Eric Wong <normalperson@yhbt.net>.
index 3ae6e74573d1b5f651f8dabc6c9569b05e049b10..41bb7e12e3d89e4876a60ea7733cffcaf09cd6ed 100644 (file)
@@ -15,7 +15,7 @@ SYNOPSIS
             [--cacheinfo <mode> <object> <file>]\*
             [--chmod=(+|-)x]
             [--assume-unchanged | --no-assume-unchanged]
-            [--really-refresh] [--unresolve] [--again]
+            [--really-refresh] [--unresolve] [--again | -g]
             [--info-only] [--index-info]
             [-z] [--stdin]
             [--verbose]
@@ -80,7 +80,7 @@ OPTIONS
        filesystem that has very slow lstat(2) system call
        (e.g. cifs).
 
---again::
+--again, -g::
        Runs `git-update-index` itself on the paths whose index
        entries are different from those from the `HEAD` commit.
 
index 3de5fa9c82de4d49a041480ce6681f69a97f167c..a9c87e38dae69b0799328917727867342eb5d22c 100644 (file)
@@ -8,8 +8,9 @@ git - the stupid content tracker
 
 SYNOPSIS
 --------
+[verse]
 'git' [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate]
-       [--bare] [--git-dir=GIT_DIR] [--help] COMMAND [ARGS]
+    [--bare] [--git-dir=GIT_DIR] [--help] COMMAND [ARGS]
 
 DESCRIPTION
 -----------
index cb482bf98ef9e2509ab2d2e1665933687538a574..23be0050b0023cbfecc5fa271b97a7d9855a73b0 100644 (file)
@@ -3,26 +3,52 @@ gitk(1)
 
 NAME
 ----
-gitk - Some git command not yet documented.
-
+gitk - git repository browser
 
 SYNOPSIS
 --------
-'gitk' [ --option ] <args>...
+'gitk' [<option>...] [<revs>] [--] [<path>...]
 
 DESCRIPTION
 -----------
-Does something not yet documented.
+Displays changes in a repository or a selected set of commits. This includes
+visualizing the commit graph, showing information related to each commit, and
+the files in the trees of each revision.
 
+Historically, gitk was the first repository browser. It's written in tcl/tk
+and started off in a separate repository but was later merged into the main
+git repository.
 
 OPTIONS
 -------
---option::
-       Some option not yet documented.
+To control which revisions to shown, the command takes options applicable to
+the gitlink:git-rev-list[1] command. This manual page describes only the most
+frequently used options.
+
+-n <number>, --max-count=<number>::
+
+       Limits the number of commits to show.
+
+--since=<date>::
+
+       Show commits more recent than a specific date.
+
+--until=<date>::
+
+       Show commits older than a specific date.
 
-<args>...::
-       Some argument not yet documented.
+<revs>::
 
+       Limit the revisions to show. This can be either a single revision
+       meaning show from the given revision and back, or it can be a range in
+       the form "'<from>'..'<to>'" to show all revisions between '<from>' and
+       back to '<to>'. Note, more advanced revision selection can be applied.
+
+<path>::
+
+       Limit commits to the ones touching files in the given paths. Note, to
+       avoid ambiguity wrt. revision names use "--" to separate the paths
+       from any preceeding options.
 
 Examples
 --------
@@ -37,13 +63,27 @@ gitk --since="2 weeks ago" \-- gitk::
        The "--" is necessary to avoid confusion with the *branch* named
        'gitk'
 
+See Also
+--------
+'qgit(1)'::
+       A repository browser written in C++ using Qt.
+
+'gitview(1)'::
+       A repository browser written in Python using Gtk. It's based on
+       'bzrk(1)' and distributed in the contrib area of the git repository.
+
+'tig(1)'::
+       A minimal repository browser and git tool output highlighter written
+       in C using Ncurses.
+
 Author
 ------
-Written by Paul Mackerras <paulus@samba.org>
+Written by Paul Mackerras <paulus@samba.org>.
 
 Documentation
 --------------
-Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
+Documentation by Junio C Hamano, Jonas Fonseca, and the git-list
+<git@vger.kernel.org>.
 
 GIT
 ---
index 4f0eef0ac3c2d20475b0b50e81f4d51cd4f95396..f8f5eebd2f9b6ebbad46e8d86efde535f30a194f 100644 (file)
@@ -606,9 +606,7 @@ static char *git_header_name(char *line, int llen)
         * form.
         */
        for (len = 0 ; ; len++) {
-               char c = name[len];
-
-               switch (c) {
+               switch (name[len]) {
                default:
                        continue;
                case '\n':
@@ -1907,13 +1905,13 @@ static int check_patch(struct patch *patch, struct patch *prev_patch)
 static int check_patch_list(struct patch *patch)
 {
        struct patch *prev_patch = NULL;
-       int error = 0;
+       int err = 0;
 
        for (prev_patch = NULL; patch ; patch = patch->next) {
-               error |= check_patch(patch, prev_patch);
+               err |= check_patch(patch, prev_patch);
                prev_patch = patch;
        }
-       return error;
+       return err;
 }
 
 static void show_index_list(struct patch *list)
index 0bd517b2649af37d9980f85e784f9a00c3263922..8213ce240232a1dc8a0a498972323a33e8fcb7a0 100644 (file)
@@ -293,9 +293,6 @@ static void compile_patterns(struct grep_opt *opt)
         */
        p = opt->pattern_list;
        opt->pattern_expression = compile_pattern_expr(&p);
-#if DEBUG
-       dump_pattern_exp(opt->pattern_expression, 0);
-#endif
        if (p)
                die("incomplete pattern expression: %s", p->pattern);
 }
index ff882bec474c59c9cb4bb49d723cf81febb204ad..fd1e52098174be212c51b957280f38dc6e9c0e48 100644 (file)
@@ -262,10 +262,10 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
        } else {
                for (i = 0; i < changed.nr; i++) {
                        const char *path = changed.items[i].path;
-                       int i = cache_name_pos(path, strlen(path));
-                       struct cache_entry *ce = active_cache[i];
+                       int j = cache_name_pos(path, strlen(path));
+                       struct cache_entry *ce = active_cache[j];
 
-                       if (i < 0)
+                       if (j < 0)
                                die ("Huh? Cache entry for %s unknown?", path);
                        refresh_cache_entry(ce, 0);
                }
index 2b5e6fa9ed18c20cda264dbaf9df9d3cbac93c0e..ada8338cc1d0fbf389cd346b5134595afaaa2e66 100644 (file)
@@ -232,7 +232,7 @@ static int do_push(const char *repo)
        common_argc = argc;
 
        for (i = 0; i < n; i++) {
-               int error;
+               int err;
                int dest_argc = common_argc;
                int dest_refspec_nr = refspec_nr;
                const char **dest_refspec = refspec;
@@ -248,10 +248,10 @@ static int do_push(const char *repo)
                while (dest_refspec_nr--)
                        argv[dest_argc++] = *dest_refspec++;
                argv[dest_argc] = NULL;
-               error = run_command_v(argc, argv);
-               if (!error)
+               err = run_command_v(argc, argv);
+               if (!err)
                        continue;
-               switch (error) {
+               switch (err) {
                case -ERR_RUN_COMMAND_FORK:
                        die("unable to fork for %s", sender);
                case -ERR_RUN_COMMAND_EXEC:
@@ -262,7 +262,7 @@ static int do_push(const char *repo)
                case -ERR_RUN_COMMAND_WAITPID_NOEXIT:
                        die("%s died with strange error", sender);
                default:
-                       return -error;
+                       return -err;
                }
        }
        return 0;
index e0bcb0a1e146c3f85fa98463a0d4bb5913a3f2b2..61a413590d74d0fb167d715aa754df1a8794c085 100644 (file)
@@ -275,7 +275,7 @@ static void traverse_tree(struct tree_desc *tree, struct strbuf *path)
        }
 }
 
-int git_tar_config(const char *var, const char *value)
+static int git_tar_config(const char *var, const char *value)
 {
        if (!strcmp(var, "tar.umask")) {
                if (!strcmp(value, "user")) {
index 867512647195073860f017340ac1ebd0c27fce67..0620e779b04146a01f9e06cbbcd535b106034bd6 100644 (file)
@@ -306,7 +306,7 @@ static void read_index_info(int line_termination)
 }
 
 static const char update_index_usage[] =
-"git-update-index [-q] [--add] [--replace] [--remove] [--unmerged] [--refresh] [--really-refresh] [--cacheinfo] [--chmod=(+|-)x] [--assume-unchanged] [--info-only] [--force-remove] [--stdin] [--index-info] [--unresolve] [--again] [--ignore-missing] [-z] [--verbose] [--] <file>...";
+"git-update-index [-q] [--add] [--replace] [--remove] [--unmerged] [--refresh] [--really-refresh] [--cacheinfo] [--chmod=(+|-)x] [--assume-unchanged] [--info-only] [--force-remove] [--stdin] [--index-info] [--unresolve] [--again | -g] [--ignore-missing] [-z] [--verbose] [--] <file>...";
 
 static unsigned char head_sha1[20];
 static unsigned char merge_head_sha1[20];
@@ -595,7 +595,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
                                        active_cache_changed = 0;
                                goto finish;
                        }
-                       if (!strcmp(path, "--again")) {
+                       if (!strcmp(path, "--again") || !strcmp(path, "-g")) {
                                has_errors = do_reupdate(argc - i, argv + i,
                                                         prefix, prefix_length);
                                if (has_errors)
diff --git a/cache.h b/cache.h
index e00505a343a2260055f5177bdfd7740e2d5a5e33..1f212d77a4e41009c88c4b599022295b8a12a609 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -123,7 +123,7 @@ extern int cache_errno;
 #define INDEX_ENVIRONMENT "GIT_INDEX_FILE"
 #define GRAFT_ENVIRONMENT "GIT_GRAFT_FILE"
 
-extern char *get_git_dir(void);
+extern const char *get_git_dir(void);
 extern char *get_object_directory(void);
 extern char *get_refs_directory(void);
 extern char *get_index_file(void);
index 6924df286e0a85bd49ef69e29781658ba8a17339..77c29de305fabc518edf060b0e6634d9c5c9f71e 100644 (file)
@@ -7,40 +7,50 @@ gitview - A GTK based repository browser for git
 
 SYNOPSIS
 --------
-'gitview'  [options] [args]
+'gitview' [options] [args]
 
 DESCRIPTION
 ---------
 
-Dependencies
+Dependencies:
 
 * Python 2.4
 * PyGTK 2.8 or later
 * PyCairo 1.0 or later
 
 OPTIONS
-------
-       --without-diff
-               If the user doesn't want to list the commit diffs in the main window. This may speed up the repository browsing.
-
-       <args>
-               All the valid option for git-rev-list(1)
-       Key Bindings:
-       F4:
-               To maximize the window
-       F5:
-               To reread references.
-       F11:
-               Full screen
-       F12:
-               Leave full screen
+-------
+--without-diff::
+
+       If the user doesn't want to list the commit diffs in the main window.
+       This may speed up the repository browsing.
+
+<args>::
+
+       All the valid option for gitlink:git-rev-list[1].
+
+Key Bindings
+------------
+F4::
+       To maximize the window
+
+F5::
+       To reread references.
+
+F11::
+       Full screen
+
+F12::
+       Leave full screen
 
 EXAMPLES
-------
-       gitview v2.6.12.. include/scsi drivers/scsi
-         Show as the changes since version v2.6.12 that changed any file in the include/scsi
-         or drivers/scsi subdirectories
+--------
+
+gitview v2.6.12.. include/scsi drivers/scsi::
+
+       Show as the changes since version v2.6.12 that changed any file in the
+       include/scsi or drivers/scsi subdirectories
 
-       gitview --since=2.weeks.ago
-         Show the changes during the last two weeks
+gitview --since=2.weeks.ago::
 
+       Show the changes during the last two weeks
diff --git a/date.c b/date.c
index 66be23ab21ef855ecbadeceae1dea2972efd4c2f..d780846b664530111a7bb67229987f202825e66d 100644 (file)
--- a/date.c
+++ b/date.c
@@ -584,10 +584,10 @@ static const char *approxidate_alpha(const char *date, struct tm *tm, int *num)
        const struct typelen *tl;
        const struct special *s;
        const char *end = date;
-       int n = 1, i;
+       int i;
 
-       while (isalpha(*++end))
-               n++;
+       while (isalpha(*++end));
+               ;
 
        for (i = 0; i < 12; i++) {
                int match = match_string(date, month_names[i]);
index 2b9301fc1205795e30dfd7a7493cb03cdebdb437..5dd8b2e3977a2ff724ca208621f76a898cff0389 100644 (file)
@@ -42,7 +42,7 @@ static void add_to_known_names(const char *path,
        struct commit_name *name = xmalloc(sizeof(struct commit_name) + len);
 
        name->commit = commit;
-       name->prio = prio; 
+       name->prio = prio;
        memcpy(name->path, path, len);
        idx = names;
        if (idx >= allocs) {
@@ -154,7 +154,7 @@ int main(int argc, char **argv)
                        tags = 1;
                else if (!strncmp(arg, "--abbrev=", 9)) {
                        abbrev = strtoul(arg + 9, NULL, 10);
-                       if (abbrev < MINIMUM_ABBREV || 40 <= abbrev)
+                       if (abbrev < MINIMUM_ABBREV || 40 < abbrev)
                                abbrev = DEFAULT_ABBREV;
                }
                else
index e6bd0033b4666f52dc756b6e2b0d5a1745b0c6b9..5fae9ac3056dd00beba3b9a13be99f7bb39d584e 100644 (file)
@@ -25,8 +25,9 @@ int zlib_compression_level = Z_DEFAULT_COMPRESSION;
 int pager_in_use;
 int pager_use_color = 1;
 
-static char *git_dir, *git_object_dir, *git_index_file, *git_refs_dir,
-       *git_graft_file;
+static const char *git_dir;
+static char *git_object_dir, *git_index_file, *git_refs_dir, *git_graft_file;
+
 static void setup_git_env(void)
 {
        git_dir = getenv(GIT_DIR_ENVIRONMENT);
@@ -49,7 +50,7 @@ static void setup_git_env(void)
                git_graft_file = strdup(git_path("info/grafts"));
 }
 
-char *get_git_dir(void)
+const char *get_git_dir(void)
 {
        if (!git_dir)
                setup_git_env();
index 0d58bb9b37944728baa7d8af17d714f6ee8b4509..9382a15044987fd97bfc659b2b0ed6eba334af1a 100755 (executable)
@@ -51,7 +51,8 @@
        $_message, $_file, $_follow_parent, $_no_metadata,
        $_template, $_shared, $_no_default_regex, $_no_graft_copy,
        $_limit, $_verbose, $_incremental, $_oneline, $_l_fmt, $_show_commit,
-       $_version, $_upgrade, $_authors, $_branch_all_refs, @_opt_m);
+       $_version, $_upgrade, $_authors, $_branch_all_refs, @_opt_m,
+       $_merge, $_strategy, $_dry_run);
 my (@_branch_from, %tree_map, %users, %rusers, %equiv);
 my ($_svn_co_url_revs, $_svn_pg_peg_revs);
 my @repo_path_split_cache;
                        { 'message|m=s' => \$_message,
                          'file|F=s' => \$_file,
                        %cmt_opts } ],
+       dcommit => [ \&dcommit, 'Commit several diffs to merge with upstream',
+                       { 'merge|m|M' => \$_merge,
+                         'strategy|s=s' => \$_strategy,
+                         'dry-run|n' => \$_dry_run,
+                       %cmt_opts } ],
 );
 
 my $cmd;
@@ -500,6 +506,8 @@ sub commit_lib {
        my @lock = $SVN::Core::VERSION ge '1.2.0' ? (undef, 0) : ();
        my $commit_msg = "$GIT_SVN_DIR/.svn-commit.tmp.$$";
 
+       my $repo;
+       ($repo, $SVN_PATH) = repo_path_split($SVN_URL);
        set_svn_commit_env();
        foreach my $c (@revs) {
                my $log_msg = get_commit_message($c, $commit_msg);
@@ -508,6 +516,8 @@ sub commit_lib {
                # can't track down... (it's probably in the SVN code)
                defined(my $pid = open my $fh, '-|') or croak $!;
                if (!$pid) {
+                       $SVN_LOG = libsvn_connect($repo);
+                       $SVN = libsvn_connect($repo);
                        my $ed = SVN::Git::Editor->new(
                                        {       r => $r_last,
                                                ra => $SVN,
@@ -557,6 +567,33 @@ sub commit_lib {
        unlink $commit_msg;
 }
 
+sub dcommit {
+       my $gs = "refs/remotes/$GIT_SVN";
+       chomp(my @refs = safe_qx(qw/git-rev-list --no-merges/, "$gs..HEAD"));
+       foreach my $d (reverse @refs) {
+               if ($_dry_run) {
+                       print "diff-tree $d~1 $d\n";
+               } else {
+                       commit_diff("$d~1", $d);
+               }
+       }
+       return if $_dry_run;
+       fetch();
+       my @diff = safe_qx(qw/git-diff-tree HEAD/, $gs);
+       my @finish;
+       if (@diff) {
+               @finish = qw/rebase/;
+               push @finish, qw/--merge/ if $_merge;
+               push @finish, "--strategy=$_strategy" if $_strategy;
+               print STDERR "W: HEAD and $gs differ, using @finish:\n", @diff;
+       } else {
+               print "No changes between current HEAD and $gs\n",
+                     "Hard resetting to the latest $gs\n";
+               @finish = qw/reset --hard/;
+       }
+       sys('git', @finish, $gs);
+}
+
 sub show_ignore {
        $SVN_URL ||= file_to_s("$GIT_SVN_DIR/info/url");
        $_use_lib ? show_ignore_lib() : show_ignore_cmd();
diff --git a/git.c b/git.c
index 930998bbe542cbaa92b3f16a6b0dc0d6ad43b874..a01d195c2319fd21fb361e535c5d6333550e3dbd 100644 (file)
--- a/git.c
+++ b/git.c
@@ -292,11 +292,11 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
                if (p->option & USE_PAGER)
                        setup_pager();
                if (getenv("GIT_TRACE")) {
-                       int i;
+                       int j;
                        fprintf(stderr, "trace: built-in: git");
-                       for (i = 0; i < argc; ++i) {
+                       for (j = 0; j < argc; ++j) {
                                fputc(' ', stderr);
-                               sq_quote_print(stderr, argv[i]);
+                               sq_quote_print(stderr, argv[j]);
                        }
                        putc('\n', stderr);
                        fflush(stderr);
index 04282fa5e381c1dc156085281e8517fb69be6192..966c54a63cacf20d2a71241f738df0378e46f569 100755 (executable)
@@ -1882,7 +1882,7 @@ sub git_blame {
                chomp $line;
                $line_class_num = ($line_class_num + 1) % $line_class_len;
 
-               if ($line =~ m/^([0-9a-fA-F]{40})\t\(\s*([^\t]+)\t(\d+) \+\d\d\d\d\t(\d+)\)(.*)$/) {
+               if ($line =~ m/^([0-9a-fA-F]{40})\t\(\s*([^\t]+)\t(\d+) [+-]\d\d\d\d\t(\d+)\)(.*)$/) {
                        $long_rev = $1;
                        $author   = $2;
                        $time     = $3;
index 8df7a0d576bfacab5ff61e0b6798cb2718401f5d..04cb238e965efdff564a9b57ce1253b274268c46 100644 (file)
@@ -1700,7 +1700,7 @@ static int locking_available(void)
        return lock_flags;
 }
 
-struct object_list **add_one_object(struct object *obj, struct object_list **p)
+static struct object_list **add_one_object(struct object *obj, struct object_list **p)
 {
        struct object_list *entry = xmalloc(sizeof(struct object_list));
        entry->item = obj;