* master: (34 commits)
gitweb: git_annotate didn't expect negative numeric timezone
git-svn: add the 'dcommit' command
git-svn: recommend rebase for syncing against an SVN repo
git-svn: establish new connections on commit after fork
describe: fix off-by-one error in --abbrev=40 handling
git-svn(1): improve asciidoc markup
gitview.txt: improve asciidoc markup
git(7): put the synopsis in a verse style paragraph
gitk(1): expand the manpage to look less like a template
git-blame(1): mention options in the synopsis and advertise pickaxe
git-ls-remote(1): document --upload-pack
git-apply(1): document missing options and improve existing ones
update-index -g
n is in fact unused, and is later shadowed.
use name[len] in switch directly, instead of creating a shadowed variable.
builtin-grep.c: remove unused debugging piece.
remove ugly shadowing of loop indexes in subloops.
missing 'static' keywords
git_dir holds pointers to local strings, hence MUST be const.
avoid to use error that shadows the function name, use err instead.
...
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:
@@ -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:
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
@@ -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
@@ -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
@@ -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
@@ -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
@ -48,7 +48,7 @@ int run_diff_files(struct rev_info *revs, int silent_on_removed)
@@ -48,7 +48,7 @@ int run_diff_files(struct rev_info *revs, int silent_on_removed)
memcpy(dpath->path, ce->name, path_len);
dpath->path[path_len] = '\0';
dpath->mode = 0;
memset(dpath->sha1, 0, 20);
hashclr(dpath->sha1);
memset(&(dpath->parent[0]), 0,
sizeof(struct combine_diff_parent)*5);
@ -66,8 +66,7 @@ int run_diff_files(struct rev_info *revs, int silent_on_removed)
@@ -66,8 +66,7 @@ int run_diff_files(struct rev_info *revs, int silent_on_removed)
if (2 <= stage) {
int mode = ntohl(nce->ce_mode);
num_compare_stages++;
memcpy(dpath->parent[stage-2].sha1,
nce->sha1, 20);
hashcpy(dpath->parent[stage-2].sha1, nce->sha1);
dpath->parent[stage-2].mode =
canon_mode(mode);
dpath->parent[stage-2].status =
@ -215,7 +214,7 @@ static int show_modified(struct rev_info *revs,
@@ -215,7 +214,7 @@ static int show_modified(struct rev_info *revs,
}
oldmode = old->ce_mode;
if (mode == oldmode && !memcmp(sha1, old->sha1, 20) &&
if (mode == oldmode && !hashcmp(sha1, old->sha1) &&
@ -265,7 +265,7 @@ static int send_pack(int in, int out, int nr_refspec, char **refspec)
@@ -265,7 +265,7 @@ static int send_pack(int in, int out, int nr_refspec, char **refspec)
char old_hex[60], *new_hex;
if (!ref->peer_ref)
continue;
if (!memcmp(ref->old_sha1, ref->peer_ref->new_sha1, 20)) {
if (!hashcmp(ref->old_sha1, ref->peer_ref->new_sha1)) {
if (verbose)
fprintf(stderr, "'%s': up-to-date\n", ref->name);
continue;
@ -310,7 +310,7 @@ static int send_pack(int in, int out, int nr_refspec, char **refspec)
@@ -310,7 +310,7 @@ static int send_pack(int in, int out, int nr_refspec, char **refspec)
@ -643,7 +655,7 @@ int check_sha1_signature(const unsigned char *sha1, void *map, unsigned long siz
@@ -643,7 +655,7 @@ int check_sha1_signature(const unsigned char *sha1, void *map, unsigned long siz
@ -1192,7 +1201,7 @@ int nth_packed_object_sha1(const struct packed_git *p, int n,
@@ -1192,7 +1201,7 @@ int nth_packed_object_sha1(const struct packed_git *p, int n,
@ -1528,7 +1537,7 @@ int write_sha1_file(void *buf, unsigned long len, const char *type, unsigned cha
@@ -1528,7 +1537,7 @@ int write_sha1_file(void *buf, unsigned long len, const char *type, unsigned cha