Commit graph

5408 commits

Author SHA1 Message Date
Eric Wong 9d55b41aad git-svn: add some functionality to better support branches in svn
New commands:

graft-branches - The most interesting command of the bunch.  It
detects branches in SVN via various techniques (currently
regexes and file copies).   It can be later extended to handle
svk and other properties people may use to track merges in svk.
Basically, merge tracking is not standardized at all in the SVN
world, and git grafts are perfect for dealing with this
situation.

Existing branch support (via tree matches) is only handled at
fetch time.

The following tow were originally implemented as shell scripts
several months ago, but I just decided to streamline things a
bit and added them to the main script.

multi-init - supports git-svnimport-like command-line syntax for
importing repositories that are layed out as recommended by the
SVN folks.  This is a bit more tolerant than the git-svnimport
command-line syntax and doesn't require the user to figure out
where the repository URL ends and where the repository path
begins.

multi-fetch - runs fetch on all known SVN branches we're
tracking.  This will NOT discover new branches (unlike
git-svnimport), so multi-init will need to be re-run (it's
idempotent).

Consider these three to be auxilliary commands (like
show-ignore, and rebuild) so their behavior won't receive as
much testing or scrutiny as the core commands (fetch and
commit).

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:20 -07:00
Eric Wong f8ab6b732f git-svn: add --shared and --template= options to pass to init-db
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:20 -07:00
Eric Wong dc5869c00d git-svn: add --repack and --repack-flags= options
This should help keep disk usage sane for large imports.

--repack takes an optional argument for the interval, it
defaults to 1000 if no argument is specified.

Arguments to --repack-flags are passed directly to git-repack.
No arguments are passed by default.

Idea stolen from git-cvsimport :)

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:20 -07:00
Eric Wong b8c92cadda git-svn: minor cleanups, extra error-checking
While we're at it, read_repo_config has been added and
expanded to handle case where command-line arguments are
optional to Getopt::Long

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:20 -07:00
Eric Wong 883d0a78d2 git-svn: Move all git-svn-related paths into $GIT_DIR/svn
Since GIT_SVN_ID usage is probably going to become more
widespread <evil grin>, we won't run the chance of somebody
having a GIT_SVN_ID name that conflicts with one of the default
directories that already exist in $GIT_DIR (branches/tags).

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:20 -07:00
Eric Wong 6dfbe5163e git-svn: support manually placed initial trees from fetch
Sometimes I don't feel like downloading an entire tree again when
I actually decide a branch is worth tracking, so some users can
get around it more easily with this.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:20 -07:00
Eric Wong 098749d9be git-svn: optimize --branch and --branch-all-ref
By breaking the pipe read once we've seen a commit twice.

This should make -B/--branch-all-ref faster and usable on a
frequent basis.

We use topological order now for calling git-rev-list, and any
commit we've seen before should imply that all parents have been
seen (at least I hope that's the case for --topo-order).

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:20 -07:00
Eric Wong bf78b1d89b git-svn: --branch-all-refs / -B support
This should make life easier for all those who type:

	`git-rev-parse --symbolic --all | xargs -n1 echo -b`

every time they run git-svn fetch.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:20 -07:00
Eric Wong 162f412921 git-svn: support -C<num> passing to git-diff-tree
The repo-config key is 'svn.copysimilarity'

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:19 -07:00
Eric Wong b63af9b340 git-svn: don't allow commit if svn tree is not current
If new revisions are fetched, that implies we haven't merged,
acked, or nacked them yet, and attempting to write the tree
we're committing means we'd silently clobber the newly fetched
changes.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:19 -07:00
Eric Wong ce475dfcb5 git-svn: restore original LC_ALL setting (or unset) for commit
svn forces UTF-8 for commit messages, and with LC_ALL set to 'C'
it is unable to determine encoding of the git commit message.

Now we'll just assume the user has set LC_* correctly for
the commit message they're using.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:19 -07:00
Eric Wong 4a393f2b53 git-svn: eol_cp corner-case fixes
If we read the maximum size of our buffer into $buf, and the
last character is '\015', there's a chance that the character is
'\012', which means our regex won't work correctly.  At the
worst case, this could introduce an extra newline into the code.
We'll now read an extra character if we see '\015' is the last
character in $buf.

We also forgot to recalculate the length of $buf after doing the
newline substitution, causing some files to appeare truncated.
We'll do that now and force byte semantics in length() for good
measure.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:19 -07:00
Eric Wong 8a97e36888 git-svn: fix handling of filenames with embedded '@'
svn has trouble parsing files with embedded '@' characters.  For
example,

  svn propget svn:keywords foo@bar.c
  svn: Syntax error parsing revision 'bar.c'

I asked about this on #svn and the workaround suggested was to append
an explicit revision specifier:

  svn propget svn:keywords foo@bar.c@BASE

This patch appends '@BASE' to the filename in all calls to 'svn
propget'.

Patch originally by Seth Falcon <sethfalcon@gmail.com>
Seth: signoff?

[ew: Made to work with older svn that don't support peg revisions]

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:19 -07:00
Eric Wong c7162c1db6 git-svn: t0000: add -f flag to checkout
Some changes to the latest git.git made this test croak.  So
we'll always just force everything when using a new branch.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:19 -07:00
Junio C Hamano b642d9ef64 Merge git://git.kernel.org/pub/scm/gitk/gitk
* git://git.kernel.org/pub/scm/gitk/gitk:
  [PATCH] gitk: rereadrefs needs listrefs
2006-06-13 10:53:41 -07:00
Junio C Hamano 2e1ded44f7 [PATCH] gitk: rereadrefs needs listrefs
The listrefs procedure was inadvertently removed during the course of
development, but there is still a user of it, so resurrect it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-06-12 09:37:44 +10:00
Junio C Hamano ada5853c98 Merge branch 'master' into next
* master: (148 commits)
  GIT 1.4.0
  v267
  prepend '--' to filelist when calling git-diff-tree
  v266
  remove Christian's email address
  v265
  handle utf8 characters from /etc/passwd
  v264
  fix: Use of uninitialized value
  v263
  allow working in repositories with textual symref HEAD
  resolve textual hashes when looking up "refs"
  v262
  define default colors
  v261
  fix leading whitespace in commit text
  more tags
  v260
  attach tag to the link
  v259
  ...
2006-06-10 14:07:46 -07:00
Junio C Hamano 41292ddd37 GIT 1.4.0
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-10 12:41:54 -07:00
Junio C Hamano 0a8f4f0020 Merge git://git.kernel.org/pub/scm/git/gitweb 2006-06-10 11:20:59 -07:00
Rene Scharfe 52ba03cbb1 Built-in git-get-tar-commit-id
By being an internal command git-get-commit-id can make use of
struct ustar_header and other stuff and stops wasting precious
disk space.

Note: I recycled one of the two "tar-tree" entries instead of
splitting that cleanup into a separate patch.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-10 11:14:00 -07:00
Junio C Hamano 67d4160712 Merge branch 'jc/shared' into next
* jc/shared:
  shared repository: optionally allow reading to "others".
  git-clone: fix --bare over dumb-http
  shared repository - add a few missing calls to adjust_shared_perm().
  Fix formatting of Documentation/git-clone.txt
  builtin-init-db: spell the in-program configuration variable in lowercase.
2006-06-10 01:31:58 -07:00
Junio C Hamano 94df2506ed shared repository: optionally allow reading to "others".
This enhances core.sharedrepository to have additionally
specify that read and exec permissions to be given to others as
well.  It is useful when serving a repository via gitweb and
git-daemon that runs as a user outside the project group.

The configuration item can take the following values:

    [core]
	sharedrepository 	 ; the same as "group"
	sharedrepository = true  ; ditto
	sharedrepository = 1	 ; ditto
	sharedrepository = group ; allow rwx to group
	sharedrepository = all   ; allow rwx to group, allow rx to other
	sharedrepository = umask ; not shared - use umask

It also extends "git init-db" to take "--shared=all" and friends
from the command line.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-10 01:31:31 -07:00
Junio C Hamano 5e3a620cd5 git-clone: fix --bare over dumb-http
It left an extra .git/ directory under the target directory by
mistake.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-10 01:12:50 -07:00
Junio C Hamano 138086a725 shared repository - add a few missing calls to adjust_shared_perm().
There were a few calls to adjust_shared_perm() that were
missing:

 - init-db creates refs, refs/heads, and refs/tags before
   reading from templates that could specify sharedrepository in
   the config file;

 - updating config file created it under user's umask without
   adjusting;

 - updating refs created it under user's umask without
   adjusting;

 - switching branches created .git/HEAD under user's umask
   without adjusting.

This moves adjust_shared_perm() from sha1_file.c to path.c,
since a few SIMPLE_PROGRAM need to call repository configuration
functions which in turn need to call adjust_shared_perm().
sha1_file.c needs to link with SHA1 computation library which
is usually not linked to SIMPLE_PROGRAM.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-09 22:15:50 -07:00
Horst H. von Brand f6407823d1 Fix formatting of Documentation/git-clone.txt
Signed-off-by: Horst H. von Brand <vonbrand@inf.utfsm.cl>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-09 20:37:45 -07:00
Junio C Hamano e9b9368168 builtin-init-db: spell the in-program configuration variable in lowercase.
Just for consistency -- setup.c spells it in lowercase.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-09 15:26:08 -07:00
Junio C Hamano 55becd7b5f Merge branch 'pe/date' into next
* pe/date:
  date.c: improve guess between timezone offset and year.
  git-rm: honor -n flag.
  git-clone: fix duplicated "master" in $GIT_DIR/remotes/origin
  check for error return from fork()
  Document git-clone --use-separate-remote
2006-06-08 21:23:35 -07:00
Paul Eggert 7122f82f56 date.c: improve guess between timezone offset and year.
When match_digit() guesses a four-digit string to tell if it is
a year or a timezone, it did not consider that some real-world
places have UTC offsets equal to +1400.

   $ date; TZ=UTC0 date; TZ=Pacific/Kiritimati date
   Wed Jun  7 23:25:42 PDT 2006
   Thu Jun  8 06:25:42 UTC 2006
   Thu Jun  8 20:25:42 LINT 2006

Signed-off-by: Paul Eggert <eggert@CS.UCLA.EDU>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-08 21:22:33 -07:00
Junio C Hamano 7612a1efdb git-rm: honor -n flag.
Even when invoked with -n flag, git-rm removed the matching
paths anyway.  Also includes the missing check spotted by
SungHyun Nam, which caused it to segfault.  Now we refuse to run
without any paths.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-08 21:11:25 -07:00
Junio C Hamano 2048bb00ee git-clone: fix duplicated "master" in $GIT_DIR/remotes/origin
Under --use-separate-remote we ended up duplicating the branch
remote HEAD pointed at in $GIT_DIR/remotes/origin file.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-08 16:19:37 -07:00
Paul T Darga c9bc159d7f check for error return from fork()
Trivial fixup for fork() callsites which do not check for errors.

Signed-off-by: Paul T Darga <pdarga@umich.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-08 11:57:00 -07:00
Uwe Zeisberger fb6a9f93d3 Document git-clone --use-separate-remote
Signed-off-by: Uwe Zeisberger <uzeisberger@io.fsforth.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-08 00:37:41 -07:00
Junio C Hamano a95e01885a Merge branch 'master' into next
* master:
  Documentation: add another example to git-ls-files
2006-06-07 20:19:18 -07:00
Junio C Hamano b86bec6c4f Documentation: add another example to git-ls-files
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-07 20:19:00 -07:00
Junio C Hamano ab1b3af792 Merge branch 'master' into next
* master:
  Documentation: git aliases
  git-cvsserver asciidoc formatting tweaks
  config.txt grammar, typo, and asciidoc fixes
  Documentation: git-ls-tree (typofix)
  Document git-ls-tree --fullname
  Document git aliases support
  make clean: remove dist-doc targets.
  Misc doc improvements
  Documentation: add missing docs make check-docs found.
  Some doc typo fixes
  Off-by-one error in get_path_prefix(), found by Valgrind
  gitk: Re-read the descendent/ancestor tag & head info on update
2006-06-07 17:27:09 -07:00
Petr Baudis 99b41c84a5 Documentation: git aliases
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-07 17:25:21 -07:00
Francis Daly 0fc8573d4b git-cvsserver asciidoc formatting tweaks
No content change here.

html output improved. man output changed.

Signed-off-by: Francis Daly <francis@daoine.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-07 16:32:50 -07:00
Francis Daly b8936cf060 config.txt grammar, typo, and asciidoc fixes
Nothing major.

Signed-off-by: Francis Daly <francis@daoine.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-07 16:32:35 -07:00
Junio C Hamano 4269822012 Documentation: git-ls-tree (typofix)
spotted by jdl.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-07 16:29:36 -07:00
Jonas Fonseca fd7e9fb7ae Document git-ls-tree --fullname
Additionally, reformat synopsis and remove stub notice.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-07 12:48:34 -07:00
Petr Baudis 4514ad4fb7 Document git aliases support
This patch ports and modifies appropriately the git aliases documentation
from my patch, shall it rest in peace.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-07 12:37:46 -07:00
Junio C Hamano 9dc2164ab3 make clean: remove dist-doc targets.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-07 12:37:46 -07:00
Jonas Fonseca 74237d6236 Misc doc improvements
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-07 12:37:46 -07:00
Junio C Hamano 34925d35ff Documentation: add missing docs make check-docs found.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-07 11:49:35 -07:00
Francis Daly 3742506578 Some doc typo fixes
All should be clear enough, except perhaps committish / commitish.
I just kept the more-used one within the current docs.

[jc: with rephrasing of check-ref-format description later discussed
 on the list]

Signed-off-by: Francis Daly <francis@daoine.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-07 11:49:35 -07:00
Rene Scharfe 17cf250aff Off-by-one error in get_path_prefix(), found by Valgrind
[jc: original fix was done by Pavel and this contains improvements
 by Rene.]

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Acked-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-07 11:49:08 -07:00
Junio C Hamano 7fb23e6083 Merge git://git.kernel.org/pub/scm/gitk/gitk
* git://git.kernel.org/pub/scm/gitk/gitk:
  gitk: Re-read the descendent/ancestor tag & head info on update
  gitk: Show branch name(s) as well, if "show nearby tags" is enabled
  gitk: Show nearby tags
  gitk: Add a goto next/previous highlighted commit function
  gitk: Provide ability to highlight based on relationship to selected commit
  gitk: Fix bug in highlight stuff when no line is selected
  gitk: Move "pickaxe" find function to highlight facility
  gitk: Improve the text window search function
  gitk: First cut at a search function in the patch/file display window
  gitk: Highlight paths of interest in tree view as well
  gitk: Highlight entries in the file list as well
  gitk: Make a row of controls for controlling highlighting
2006-06-06 23:24:27 -07:00
Junio C Hamano fd4c6cc9d6 Merge branch 'master' into next
* master:
  http-fetch: fix possible segfault
  Refactor git_tcp_connect() functions a little.
  builtin-grep: pass ignore case option to external grep
2006-06-06 22:36:10 -07:00
Nick Hengeveld e8dff6ba8b http-fetch: fix possible segfault
Initialize an object request's slot to a safe value.  A non-NULL value
can cause a segfault if the request is aborted before it starts.

Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-06 22:32:51 -07:00
Jon Loeliger 5ad312bede Refactor git_tcp_connect() functions a little.
Add client side sending of "\0host=%s\0" extended
arg for git native protocol, backwards compatibly.

Signed-off-by: Jon Loeliger <jdl@jdl.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-06 21:44:39 -07:00