git.git
15 years agogitweb: update Git homepage URL
Wincent Colaiuta [Sun, 12 Jul 2009 12:31:28 +0000 (14:31 +0200)]
gitweb: update Git homepage URL

git-scm.com is now the "official" Git project page, having taken over
from git.or.cz, so update the default link accordingly. This saves a
redirect when people hit git.or.cz.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit svn: allow uppercase UUIDs from SVN
Eric Wong [Sat, 11 Jul 2009 21:13:12 +0000 (14:13 -0700)]
git svn: allow uppercase UUIDs from SVN

SVN allows uppercase A-F characters in repositories.  Although
`svnadmin' does not create UUIDs with uppercase by default, it
is possible to change the UUID of a SVN repository and SVN
itself will make no attempt to normalize them.

Thanks to Esben Skovenborg for discovering this issue.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
15 years agogit-svn: Fix branch detection when repository root is inaccessible
Mattias Nissler [Mon, 6 Jul 2009 23:40:02 +0000 (01:40 +0200)]
git-svn: Fix branch detection when repository root is inaccessible

For the case of multiple projects sharing a single SVN repository, it is
common practice to create the standard SVN directory layout within a
subdirectory for each project. In such setups, access control is often
used to limit what projects a given user may access. git-svn failed to
detect branches (e.g. when passing --stdlayout to clone) because it
relied on having access to the root directory in the repository. This
patch solves this problem by making git-svn use paths relative to the
given repository URL instead of the repository root.

Signed-off-by: Mattias Nissler <mattias.nissler@gmx.de>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit-svn: Always duplicate paths returned from get_log
Mattias Nissler [Mon, 6 Jul 2009 23:39:52 +0000 (01:39 +0200)]
git-svn: Always duplicate paths returned from get_log

This makes get_log more safe to use because callers cannot run into path
clobbering any more. The additional overhead will not affect performance
since the critical calls from the fetch loop need the path duplication
anyway and the rest of the call sites is not performance critical.

Signed-off-by: Mattias Nissler <mattias.nissler@gmx.de>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agoquickfetch(): Prevent overflow of the rev-list command line
Johan Herland [Thu, 9 Jul 2009 23:52:30 +0000 (01:52 +0200)]
quickfetch(): Prevent overflow of the rev-list command line

quickfetch() calls rev-list to check whether the objects we are about to
fetch are already present in the repo (if so, we can skip the object fetch).
However, when there are many (~1000) refs to be fetched, the rev-list
command line grows larger than the maximum command line size on some systems
(32K in Windows). This causes rev-list to fail, making quickfetch() return
non-zero, which unnecessarily triggers the transport machinery. This somehow
causes fetch to fail with an exit code.

By using the --stdin option to rev-list (and feeding the object list to its
standard input), we prevent the overflow of the rev-list command line,
which causes quickfetch(), and subsequently the overall fetch, to succeed.

However, using rev-list --stdin is not entirely straightforward: rev-list
terminates immediately when encountering an unknown object, which can
trigger SIGPIPE if we are still writing object's to its standard input.
We therefore temporarily ignore SIGPIPE so that the fetch process is not
terminated.

The patch also contains a testcase to verify the fix (note that before
the patch, the testcase would only fail on msysGit).

Signed-off-by: Johan Herland <johan@herland.net>
Improved-by: Johannes Sixt <j6t@kdbg.org>
Improved-by: Alex Riesen <raa.lkml@gmail.com>
Tested-by: Peter Krefting <peter@softwolves.pp.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMakefile: update IRIX64 section
Brandon Casey [Fri, 10 Jul 2009 18:31:19 +0000 (13:31 -0500)]
Makefile: update IRIX64 section

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMakefile: add section for SGI IRIX 6.5
Brandon Casey [Fri, 10 Jul 2009 17:10:46 +0000 (12:10 -0500)]
Makefile: add section for SGI IRIX 6.5

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMakefile: add NEEDS_LIBGEN to optionally add -lgen to compile arguments
Brandon Casey [Fri, 10 Jul 2009 17:10:45 +0000 (12:10 -0500)]
Makefile: add NEEDS_LIBGEN to optionally add -lgen to compile arguments

Commit 003b33a8 recently added a call to basename().  On IRIX 6.5, this
function resides in libgen and -lgen is required for the linker.

Update configure.ac too.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-compat-util.h: adjust for SGI IRIX 6.5
Brandon Casey [Fri, 10 Jul 2009 17:10:44 +0000 (12:10 -0500)]
git-compat-util.h: adjust for SGI IRIX 6.5

Don't define _XOPEN_SOURCE
Do    define _SGI_SOURCE

Defining _XOPEN_SOURCE prevents many of the common functions and macros
from being defined. _Not_ setting _XOPEN_SOURCE, and instead setting
_SGI_SOURCE, provides all of the XPG4, XPG5, BSD, POSIX functions and
declarations, _BUT_ provides a horribly broken snprintf(). SGI does have
a working snprintf(), but it is only provided when _NO_XOPEN5 evaluates
to zero, and this only happens if _XOPEN_SOURCE is defined which, as
mentioned above, prevents many other common functions and defines.

The broken snprintf will be worked around with SNPRINTF_RETURNS_BOGUS in
the Makefile in a later patch.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agounpack-trees.c: work around run-time array initialization flaw on IRIX 6.5
Brandon Casey [Fri, 10 Jul 2009 17:10:43 +0000 (12:10 -0500)]
unpack-trees.c: work around run-time array initialization flaw on IRIX 6.5

The c99 MIPSpro Compiler version 7.4.4m on IRIX 6.5 does not properly
initialize run-time initialized arrays.  An array which is initialized with
fewer elements than the length of the array should have the unitialized
elements initialized to zero.  This compiler only initializes the remaining
elements when the last element is a static parameter.  So work around it
by adding a "NULL" initialization parameter.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'lt/dir-cleanup'
Junio C Hamano [Sat, 11 Jul 2009 03:18:37 +0000 (20:18 -0700)]
Merge branch 'lt/dir-cleanup'

* lt/dir-cleanup:
  Make index preloading check the whole path to the file
  Export thread-safe version of 'has_symlink_leading_path()'
  Prepare symlink caching for thread-safety
  Avoid using 'lstat()' to figure out directories
  Avoid doing extra 'lstat()'s for d_type if we have an up-to-date cache entry
  Simplify read_directory[_recursive]() arguments
  Add 'fill_directory()' helper function for directory traversal

15 years agoMerge branch 'ae/maint-mailinfo-rm-only-one-patch-marker'
Junio C Hamano [Sat, 11 Jul 2009 03:18:09 +0000 (20:18 -0700)]
Merge branch 'ae/maint-mailinfo-rm-only-one-patch-marker'

* ae/maint-mailinfo-rm-only-one-patch-marker:
  mailinfo: Remove only one set of square brackets

15 years agoMakefile: keep "git" when bindir is execdir
Junio C Hamano [Sat, 11 Jul 2009 03:17:33 +0000 (20:17 -0700)]
Makefile: keep "git" when bindir is execdir

For some reason there still are people who use the old style layout
to put everything in $(bindir).  The previous commit breaks the install
for them, because it tries to unconditionally remove git from execdir
and cp/ln from bindir --- oops.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMake index preloading check the whole path to the file
Linus Torvalds [Thu, 9 Jul 2009 20:37:02 +0000 (13:37 -0700)]
Make index preloading check the whole path to the file

This uses the new thread-safe 'threaded_has_symlink_leading_path()'
function to efficiently verify that the whole path leading up to the
filename is a proper path, and does not contain symlinks.

This makes 'ce_uptodate()' a much stronger guarantee: it no longer just
guarantees that the 'lstat()' of the path would match, it also means
that we know that people haven't played games with moving directories
around and covered it up with symlinks.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoExport thread-safe version of 'has_symlink_leading_path()'
Linus Torvalds [Thu, 9 Jul 2009 20:35:31 +0000 (13:35 -0700)]
Export thread-safe version of 'has_symlink_leading_path()'

The threaded index preloading will want it, so that it can avoid
locking by simply using a per-thread symlink/directory cache.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoPrepare symlink caching for thread-safety
Linus Torvalds [Thu, 9 Jul 2009 20:23:59 +0000 (13:23 -0700)]
Prepare symlink caching for thread-safety

This doesn't actually change the external interfaces, so they are still
thread-unsafe, but it makes the code internally pass a pointer to a
local 'struct cache_def' around, so that the core code can be made
thread-safe.

The threaded index preloading will want to verify that the paths leading
up to a pathname are all real directories.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAvoid using 'lstat()' to figure out directories
Linus Torvalds [Thu, 9 Jul 2009 20:14:28 +0000 (13:14 -0700)]
Avoid using 'lstat()' to figure out directories

If we have an up-to-date index entry for a file in that directory, we
can know that the directories leading up to that file must be
directories.  No need to do an lstat() on the directory.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMakefile: install 'git' in execdir v1.6.4-rc0
Jeff King [Thu, 9 Jul 2009 06:37:35 +0000 (02:37 -0400)]
Makefile: install 'git' in execdir

When a git command executes a subcommand, it uses the "git
foo" form, which relies on finding "git" in the PATH.
Normally this should not be a problem, since the same "git"
that was used to invoke git in the first place will be
found.  And if somebody invokes a "git" outside of the PATH
(e.g., by giving its absolute path), this case is already
covered: we put that absolute path onto the front of PATH.

However, if one is using "sudo", then sudo will execute the
"git" from the PATH, but pass along a restricted PATH that
may not contain the original "git" directory. In this case,
executing a subcommand will fail.

To solve this, we put the "git" wrapper itself into the
execdir; this directory is prepended to the PATH when git
starts, so the wrapper will always be found.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAvoid doing extra 'lstat()'s for d_type if we have an up-to-date cache entry
Linus Torvalds [Thu, 9 Jul 2009 02:31:49 +0000 (19:31 -0700)]
Avoid doing extra 'lstat()'s for d_type if we have an up-to-date cache entry

On filesystems without d_type, we can look at the cache entry first.
Doing an lstat() can be expensive.

Reported by Dmitry Potapov for Cygwin.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoSimplify read_directory[_recursive]() arguments
Linus Torvalds [Thu, 9 Jul 2009 02:24:39 +0000 (19:24 -0700)]
Simplify read_directory[_recursive]() arguments

Stop the insanity with separate 'path' and 'base' arguments that must
match.  We don't need that crazy interface any more, since we cleaned up
handling of 'path' in commit da4b3e8c28b1dc2b856d2555ac7bb47ab712598c.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdd 'fill_directory()' helper function for directory traversal
Linus Torvalds [Thu, 14 May 2009 20:22:36 +0000 (13:22 -0700)]
Add 'fill_directory()' helper function for directory traversal

Most of the users of "read_directory()" actually want a much simpler
interface than the whole complex (but rather powerful) one.

In fact 'git add' had already largely abstracted out the core interface
issues into a private "fill_directory()" function that was largely
applicable almost as-is to a number of callers.  Yes, 'git add' wants to
do some extra work of its own, specific to the add semantics, but we can
easily split that out, and use the core as a generic function.

This function does exactly that, and now that much simplified
'fill_directory()' function can be shared with a number of callers,
while also ensuring that the rather more complex calling conventions of
read_directory() are used by fewer call-sites.

This also makes the 'common_prefix()' helper function private to dir.c,
since all callers are now in that file.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'ld/push-porcelain-output-format'
Junio C Hamano [Thu, 9 Jul 2009 08:07:54 +0000 (01:07 -0700)]
Merge branch 'ld/push-porcelain-output-format'

* ld/push-porcelain-output-format:
  add --porcelain option to git-push

15 years agoMerge branch 'gb/gitweb-avatar'
Junio C Hamano [Thu, 9 Jul 2009 08:00:59 +0000 (01:00 -0700)]
Merge branch 'gb/gitweb-avatar'

* gb/gitweb-avatar:
  gitweb: add empty alt text to avatar img
  gitweb: picon avatar provider
  gitweb: gravatar url cache
  gitweb: (gr)avatar support
  gitweb: use git_print_authorship_rows in 'tag' view too
  gitweb: uniform author info for commit and commitdiff
  gitweb: refactor author name insertion

15 years agoMerge branch 'ml/http'
Junio C Hamano [Thu, 9 Jul 2009 08:00:36 +0000 (01:00 -0700)]
Merge branch 'ml/http'

* ml/http:
  http.c: add http.sslCertPasswordProtected option
  http.c: prompt for SSL client certificate password

Conflicts:
http.c

15 years agoMerge branch 'rs/grep-p'
Junio C Hamano [Thu, 9 Jul 2009 07:59:58 +0000 (00:59 -0700)]
Merge branch 'rs/grep-p'

* rs/grep-p:
  grep: simplify -p output
  grep -p: support user defined regular expressions
  grep: add option -p/--show-function
  grep: handle pre context lines on demand
  grep: print context hunk marks between files
  grep: move context hunk mark handling into show_line()
  userdiff: add xdiff_clear_find_func()

15 years agoMerge branch 'js/run-command-updates' (early part)
Junio C Hamano [Thu, 9 Jul 2009 07:59:32 +0000 (00:59 -0700)]
Merge branch 'js/run-command-updates' (early part)

* 'js/run-command-updates' (early part):
  MinGW: truncate exit()'s argument to lowest 8 bits

15 years agomailinfo: Remove only one set of square brackets
Andreas Ericsson [Mon, 29 Jun 2009 09:55:51 +0000 (11:55 +0200)]
mailinfo: Remove only one set of square brackets

git-format-patch prepends patches with a [PATCH x/n] prefix, but
mailinfo used to remove any number of square-bracket pairs and
the content between them. This prevents one from using a commit
subject like this:

  [ and ] must be allowed as input

Removing the square bracket pair from this rather clumsily
constructed subject line loses important information, so we must
take care not to.

This patch causes the subject stripping to stop after it has
encountered one pair of square brackets.

One possible downside of this patch is that the patch-handling
programs will now fail at removing author-added square-brackets
to be removed, such as

  [RFC][PATCH x/n]

However, since format-patch only adds one set of square brackets,
this behaviour is quite easily undesrstood and defended while the
previous behaviour is not.

Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-svn.txt: fix description of fetch flags accepted by clone.
Yann Dirson [Tue, 7 Jul 2009 20:22:22 +0000 (22:22 +0200)]
git-svn.txt: fix description of fetch flags accepted by clone.

Signed-off-by: Yann Dirson <ydirson@altern.org>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-svn.txt: fix fetch flags incorrectly documented as init flags.
Yann Dirson [Tue, 7 Jul 2009 20:22:21 +0000 (22:22 +0200)]
git-svn.txt: fix fetch flags incorrectly documented as init flags.

Signed-off-by: Yann Dirson <ydirson@altern.org>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-svn.txt: make formatting more consistent.
Yann Dirson [Tue, 7 Jul 2009 20:22:20 +0000 (22:22 +0200)]
git-svn.txt: make formatting more consistent.

- correctly link paragraphs within list items
- consistently format examples
- put option alernatives on separate lines
- always use [verse] for config items
- always indent 1st paragraph of a list item, with a tab

Signed-off-by: Yann Dirson <ydirson@altern.org>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-svn.txt: stop using dash-form of commands.
Yann Dirson [Tue, 7 Jul 2009 20:22:19 +0000 (22:22 +0200)]
git-svn.txt: stop using dash-form of commands.

Also consistently use single quotes around git commands to make things clear
(was only needed at a couple of places).

Signed-off-by: Yann Dirson <ydirson@altern.org>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Wed, 8 Jul 2009 17:42:23 +0000 (10:42 -0700)]
Merge branch 'maint'

* maint:
  Documentation: update description of shell aliases

15 years agoMerge branch 'cb/maint-fetch-refspec-wo-dst' into maint
Junio C Hamano [Wed, 8 Jul 2009 16:52:25 +0000 (09:52 -0700)]
Merge branch 'cb/maint-fetch-refspec-wo-dst' into maint

* cb/maint-fetch-refspec-wo-dst:
  fetch: do not create ref from empty name

15 years agoMerge branch 'cf/maint-remote-uploadpack-useconfig-fix' into maint
Junio C Hamano [Wed, 8 Jul 2009 16:52:14 +0000 (09:52 -0700)]
Merge branch 'cf/maint-remote-uploadpack-useconfig-fix' into maint

* cf/maint-remote-uploadpack-useconfig-fix:
  git-remote: fix missing .uploadpack usage for show command

15 years agoDocumentation: update description of shell aliases
Sitaram Chamarty [Wed, 1 Jul 2009 16:00:31 +0000 (21:30 +0530)]
Documentation: update description of shell aliases

Aliases that invoke shell commands start from the top-level directory,
but this was not documented.

Signed-off-by: Sitaram Chamarty <sitaramc@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocompletion: __git_config_get_set_variables() handle values with spaces
Stephen Boyd [Tue, 30 Jun 2009 05:08:38 +0000 (22:08 -0700)]
completion: __git_config_get_set_variables() handle values with spaces

Commit 0065236 (bash completion: complete variable names for "git
config" with options 2009-05-08) implemented its config variable search
wrong. When a config contains a value with a space and a period (.) in
it, completion erroneously thinks that line in the configuration is
multiple config variables.

For example

 $ cat .git/config
   format.cc = Junio C Hamano <gitster@pobox.com>

 $ git config --unset <TAB>
   format.cc
   <gitster@pobox.com>

Instead of using a for loop splitting across spaces, pipe each line to a
while read loop and beef up the case statement to match only
'config.variable=value'.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'tr/die_errno'
Junio C Hamano [Mon, 6 Jul 2009 16:39:46 +0000 (09:39 -0700)]
Merge branch 'tr/die_errno'

* tr/die_errno:
  Use die_errno() instead of die() when checking syscalls
  Convert existing die(..., strerror(errno)) to die_errno()
  die_errno(): double % in strerror() output just in case
  Introduce die_errno() that appends strerror(errno) to die()

15 years agoMerge branch 'cb/maint-fetch-refspec-wo-dst'
Junio C Hamano [Mon, 6 Jul 2009 16:39:38 +0000 (09:39 -0700)]
Merge branch 'cb/maint-fetch-refspec-wo-dst'

* cb/maint-fetch-refspec-wo-dst:
  fetch: do not create ref from empty name

15 years agoMerge branch 'sb/show-ref-parse-options'
Junio C Hamano [Mon, 6 Jul 2009 16:38:58 +0000 (09:38 -0700)]
Merge branch 'sb/show-ref-parse-options'

* sb/show-ref-parse-options:
  show-ref: migrate to parse-options

15 years agoMerge branch 'gb/am-foreign'
Junio C Hamano [Mon, 6 Jul 2009 16:38:33 +0000 (09:38 -0700)]
Merge branch 'gb/am-foreign'

* gb/am-foreign:
  git-am: refactor 'cleaning up and aborting'
  git-am foreign patch support: StGIT support
  git-am foreign patch support: autodetect some patch formats
  git-am foreign patch support: introduce patch_format

15 years agoMerge branch 'jk/use-our-regexp'
Junio C Hamano [Mon, 6 Jul 2009 16:38:08 +0000 (09:38 -0700)]
Merge branch 'jk/use-our-regexp'

* jk/use-our-regexp:
  Makefile: Solaris needs HAVE_ALLOCA_H for alloca()
  Makefile: use compat regex on Solaris
  Makefile: refactor regex compat support

15 years agoMerge branch 'uk/rev-parse-parse-opt'
Junio C Hamano [Mon, 6 Jul 2009 16:38:01 +0000 (09:38 -0700)]
Merge branch 'uk/rev-parse-parse-opt'

* uk/rev-parse-parse-opt:
  parse-opt: make PARSE_OPT_STOP_AT_NON_OPTION available to git rev-parse
  more tests for git rev-parse --parse-opt

15 years agoAvoid generating a warning if $fullname{$file} is undefined
Nick Woolley [Mon, 6 Jul 2009 13:33:45 +0000 (14:33 +0100)]
Avoid generating a warning if $fullname{$file} is undefined

Signed-off-by: Nick Woolley <git.wu-lee@noodlefactory.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoRemove archaic use of regex capture \1 in favour of $1
Nick Woolley [Mon, 6 Jul 2009 13:33:07 +0000 (14:33 +0100)]
Remove archaic use of regex capture \1 in favour of $1

Using it will generate a perl warning "\1 better written as $1".

Signed-off-by: Nick Woolley <git.wu-lee@noodlefactory.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocompletion: Add --full-diff to log options
Todd Zullinger [Wed, 3 Jun 2009 20:20:58 +0000 (16:20 -0400)]
completion: Add --full-diff to log options

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAllow the Unix epoch to be a valid commit date
Eric Wong [Fri, 3 Jul 2009 04:34:54 +0000 (21:34 -0700)]
Allow the Unix epoch to be a valid commit date

It is common practice to use the Unix epoch as a fallback date
when a suitable date is not available.  This is true of git svn
and possibly other importing tools that import non-git history
into git.

Instead of clobbering established strtoul() error reporting
semantics with our own, preserve the strtoul() error value
of ULONG_MAX for fsck.c to handle.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agohttp-push: fix xml_entities() string parsing overrun
Hunter, D. Seth [Wed, 1 Jul 2009 00:24:47 +0000 (20:24 -0400)]
http-push: fix xml_entities() string parsing overrun

xml_entities() in http-push.c did not properly stop at the end of the
string being examined, which would occasionally cause nonsense to be
appended to escaped URL strings and result in failed DAV XML queries

Signed-off-by: Seth Hunter <hunter@ll.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMinGW: truncate exit()'s argument to lowest 8 bits
Johannes Sixt [Sun, 5 Jul 2009 18:57:46 +0000 (20:57 +0200)]
MinGW: truncate exit()'s argument to lowest 8 bits

For some reason, MinGW's bash cannot reliably detect failure of the child
process if a negative value is passed to exit(). This fixes it by
truncating the exit code in all calls of exit().

This issue was worked around in run_builtin() of git.c (2488df84 builtin
run_command: do not exit with -1, 2007-11-15). This workaround is no longer
necessary and is reverted.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogrep: simplify -p output
René Scharfe [Wed, 1 Jul 2009 22:06:34 +0000 (00:06 +0200)]
grep: simplify -p output

It was found a bit too loud to show == separators between the function
headers.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoRemove filename from conflict markers
Martin Renold [Wed, 1 Jul 2009 20:18:04 +0000 (22:18 +0200)]
Remove filename from conflict markers

Put filenames into the conflict markers only when they are different.
Otherwise they are redundant information clutter.

Print the filename explicitely when warning about a binary conflict.

Signed-off-by: Martin Renold <martinxyz@gmx.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'cc/bisect'
Junio C Hamano [Thu, 2 Jul 2009 02:41:04 +0000 (19:41 -0700)]
Merge branch 'cc/bisect'

* cc/bisect:
  Documentation: remove warning saying that "git bisect skip" may slow bisection
  bisect: use a PRNG with a bias when skipping away from untestable commits

15 years agoMerge branch 'js/daemon-log'
Junio C Hamano [Thu, 2 Jul 2009 02:41:00 +0000 (19:41 -0700)]
Merge branch 'js/daemon-log'

* js/daemon-log:
  receive-pack: do not send error details to the client
  upload-pack: squelch progress indicator if client cannot see it
  daemon: send stderr of service programs to the syslog

15 years agoMerge branch 'cf/maint-remote-uploadpack-useconfig-fix'
Junio C Hamano [Thu, 2 Jul 2009 02:40:54 +0000 (19:40 -0700)]
Merge branch 'cf/maint-remote-uploadpack-useconfig-fix'

* cf/maint-remote-uploadpack-useconfig-fix:
  git-remote: fix missing .uploadpack usage for show command

15 years agoMerge branch 'sb/quiet-porcelains'
Junio C Hamano [Thu, 2 Jul 2009 02:40:50 +0000 (19:40 -0700)]
Merge branch 'sb/quiet-porcelains'

* sb/quiet-porcelains:
  stash: teach quiet option
  am, rebase: teach quiet option
  submodule, repack: migrate to git-sh-setup's say()
  git-sh-setup: introduce say() for quiet options
  am: suppress apply errors when using 3-way
  t4150: test applying with a newline in subject

15 years agoMerge branch 'ne/maint-1.6.0-diff-tree-t-r-show-directory'
Junio C Hamano [Thu, 2 Jul 2009 02:40:47 +0000 (19:40 -0700)]
Merge branch 'ne/maint-1.6.0-diff-tree-t-r-show-directory'

* ne/maint-1.6.0-diff-tree-t-r-show-directory:
  diff-tree -r -t: include added/removed directories in the output

15 years agoMerge branch 'maint'
Junio C Hamano [Thu, 2 Jul 2009 02:40:16 +0000 (19:40 -0700)]
Merge branch 'maint'

* maint:
  request-pull: really really disable pager

15 years agogrep -p: support user defined regular expressions
René Scharfe [Wed, 1 Jul 2009 22:07:24 +0000 (00:07 +0200)]
grep -p: support user defined regular expressions

Respect the userdiff attributes and config settings when looking for
lines with function definitions in git grep -p.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogrep: add option -p/--show-function
René Scharfe [Wed, 1 Jul 2009 22:06:34 +0000 (00:06 +0200)]
grep: add option -p/--show-function

The new option -p instructs git grep to print the previous function
definition as a context line, similar to diff -p.  Such context lines
are marked with an equal sign instead of a dash.  This option
complements the existing context options -A, -B, -C.

Function definitions are detected using the same heuristic that diff
uses.  User defined regular expressions are not supported, yet.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogrep: handle pre context lines on demand
René Scharfe [Wed, 1 Jul 2009 22:05:17 +0000 (00:05 +0200)]
grep: handle pre context lines on demand

Factor out pre context line handling into the new function
show_pre_context() and change the algorithm to rewind by looking for
newline characters and roll forward again, instead of maintaining an
array of line beginnings and ends.

This is slower for hits, but the cost for non-matching lines becomes
zero.  Normally, there are far more non-matching lines, so the time
spent in total decreases.

Before this patch (current Linux kernel repo, best of five runs):

$ time git grep --no-ext-grep -B1 memset >/dev/null

real 0m2.134s
user 0m1.932s
sys 0m0.196s

$ time git grep --no-ext-grep -B1000 memset >/dev/null

real 0m12.059s
user 0m11.837s
sys 0m0.224s

The same with this patch:

$ time git grep --no-ext-grep -B1 memset >/dev/null

real 0m2.117s
user 0m1.892s
sys 0m0.228s

$ time git grep --no-ext-grep -B1000 memset >/dev/null

real 0m2.986s
user 0m2.696s
sys 0m0.288s

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogrep: print context hunk marks between files
René Scharfe [Wed, 1 Jul 2009 22:03:44 +0000 (00:03 +0200)]
grep: print context hunk marks between files

Print a hunk mark before matches from a new file are shown, in addition
to the current behaviour of printing them if lines have been skipped.

The result is easier to read, as (presumably unrelated) matches from
different files are separated by a hunk mark.  GNU grep does the same.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogrep: move context hunk mark handling into show_line()
René Scharfe [Wed, 1 Jul 2009 22:02:38 +0000 (00:02 +0200)]
grep: move context hunk mark handling into show_line()

Move last_shown into struct grep_opt, to make it available in
show_line(), and then make the function handle the printing of hunk
marks for context lines in a central place.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agouserdiff: add xdiff_clear_find_func()
René Scharfe [Wed, 1 Jul 2009 22:01:43 +0000 (00:01 +0200)]
userdiff: add xdiff_clear_find_func()

xdiff_set_find_func() is used to set user defined regular expressions
for finding function signatures.  Add xdiff_clear_find_func(), which
frees the memory allocated by the former, making the API complete.

Also, use the new function in diff.c (the only call site of
xdiff_set_find_func()) to clean up after ourselves.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agorequest-pull: really really disable pager
Michal Marek [Wed, 1 Jul 2009 09:40:30 +0000 (11:40 +0200)]
request-pull: really really disable pager

Earlier 476cc72 (request-pull: really disable pager, 2009-06-30)
tried to use the correct environment variable to disable paging
from multiple calls to "git log" and friends, but there was one
extra call to "git log" that was not covered by the trick.

Move the setting and exporting of GIT_PAGER much earlier in the
script to cover everybody.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agolog-tree: fix confusing comment
Jeff King [Wed, 1 Jul 2009 07:26:28 +0000 (03:26 -0400)]
log-tree: fix confusing comment

This comment mentions the case where use_terminator is set,
but this case is not handled at all by this chunk of code.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Tue, 30 Jun 2009 23:12:35 +0000 (16:12 -0700)]
Merge branch 'maint'

* maint:
  attr: plug minor memory leak
  request-pull: really disable pager
  Makes some cleanup/review in gittutorial
  Makefile: git.o depends on library headers
  git-submodule documentation: fix foreach example

15 years agoattr: plug minor memory leak
René Scharfe [Tue, 30 Jun 2009 22:30:00 +0000 (00:30 +0200)]
attr: plug minor memory leak

Free the memory allocated for struct strbuf pathbuf when we're done.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit.c: avoid allocating one-too-many elements for new argv array
Brandon Casey [Tue, 30 Jun 2009 20:24:13 +0000 (15:24 -0500)]
git.c: avoid allocating one-too-many elements for new argv array

When creating a new argv array from a configured alias and the supplied
command line arguments, the new argv was allocated with one element too
many.  Since the first element of the original argv array is skipped when
copying it to the new_argv, the number of elements that are allocated
should be reduced by one.  'count' is the number of elements that new_argv
contains, and *argcp is the number of elements in the original argv array.
So the total allocation (including the terminating NULL entry) for the
new_argv array should be:

  count + (*argcp - 1) + 1

Also, the explicit assignment of the NULL terminating entry can be avoided
by just copying it over from the original argv array.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agorequest-pull: really disable pager
Junio C Hamano [Tue, 30 Jun 2009 18:29:36 +0000 (11:29 -0700)]
request-pull: really disable pager

ff06c74 (Improve request-pull to handle non-rebased branches, 2007-05-01)
attempted to disable pager when running subcommands in this script, but
with a wrong variable.  If GIT_PAGER is set, it takes precedence over
PAGER.

Noticed by Michal Marek.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-mv: fix directory separator treatment on Windows
Johannes Sixt [Tue, 30 Jun 2009 13:33:57 +0000 (15:33 +0200)]
git-mv: fix directory separator treatment on Windows

The following invocations did not work as expected on Windows:

    git mv foo\bar dest
    git mv foo\ dest

The first command was interpreted as

    git mv foo/bar dest/foo/bar

because the Windows style directory separator was not obeyed when the
basename of 'foo\bar' was computed.

The second command failed because the Windows style directory separator was
not removed from the source directory, whereupon the lookup of the
directory in the index failed.

This fixes both issues by using is_dir_sep() and basename().

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocompletion: add missing config variables
Stephen Boyd [Tue, 30 Jun 2009 04:24:24 +0000 (21:24 -0700)]
completion: add missing config variables

Update to include branch.*.rebase, remote.*.pushurl, and
add.ignore-errors

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMakes some cleanup/review in gittutorial
Thadeu Lima de Souza Cascardo [Mon, 29 Jun 2009 15:13:58 +0000 (12:13 -0300)]
Makes some cleanup/review in gittutorial

There are some different but little cleanup changes to fix some missing
quotes, to fix what seemed to be an unended sentence, to reident a
little paragraph with too large a sentence and fix a branch name that
was referred to twice later by another name.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMakefile: git.o depends on library headers
Johannes Sixt [Mon, 29 Jun 2009 19:42:08 +0000 (21:42 +0200)]
Makefile: git.o depends on library headers

This dependency was not yet specified anywhere else.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-submodule documentation: fix foreach example
Miklos Vajna [Sun, 28 Jun 2009 12:55:45 +0000 (14:55 +0200)]
git-submodule documentation: fix foreach example

Backtick and apostrophe are asciidoc markup, so they should be escaped
in order to get the expected result in the rendered manual page.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: add empty alt text to avatar img
Giuseppe Bilotta [Mon, 29 Jun 2009 22:00:54 +0000 (00:00 +0200)]
gitweb: add empty alt text to avatar img

The empty alt text optimizes screen estate in text-only browsers.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: picon avatar provider
Giuseppe Bilotta [Mon, 29 Jun 2009 22:00:53 +0000 (00:00 +0200)]
gitweb: picon avatar provider

Simple implementation of picon that only relies on the indiana.edu
database.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: gravatar url cache
Giuseppe Bilotta [Mon, 29 Jun 2009 22:00:52 +0000 (00:00 +0200)]
gitweb: gravatar url cache

Views which contain many occurrences of the same email address (e.g.
shortlog view) benefit from not having to recalculate the MD5 of the
email address every time.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: (gr)avatar support
Giuseppe Bilotta [Mon, 29 Jun 2009 22:00:51 +0000 (00:00 +0200)]
gitweb: (gr)avatar support

Introduce avatar support: the feature adds the appropriate img tag next
to author and committer in commit(diff), history, shortlog, log and tag
views. Multiple avatar providers are possible, but only gravatar is
implemented at the moment.

Gravatar support depends on Digest::MD5, which is a core package since
Perl 5.8. If gravatars are activated but Digest::MD5 cannot be found,
the feature will be automatically disabled.

No avatar provider is selected by default, except in the t9500 test.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: use git_print_authorship_rows in 'tag' view too
Giuseppe Bilotta [Mon, 29 Jun 2009 22:00:50 +0000 (00:00 +0200)]
gitweb: use git_print_authorship_rows in 'tag' view too

parse_tag must be adapted to use the hash keys expected by
git_print_authorship_rows. This is not a problem since git_tag is the
only user of this sub.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: uniform author info for commit and commitdiff
Giuseppe Bilotta [Mon, 29 Jun 2009 22:00:49 +0000 (00:00 +0200)]
gitweb: uniform author info for commit and commitdiff

Switch from 'log'-like layout

    A U Thor <email@example.com> [date time]

to 'commit'-like layout

    author    A U Thor <email@example.com>
              date time
    committer C O Mitter <other.email@example.com>
              committer date time

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: refactor author name insertion
Giuseppe Bilotta [Mon, 29 Jun 2009 22:00:48 +0000 (00:00 +0200)]
gitweb: refactor author name insertion

Collect all author display code in appropriate functions, making it
easier to extend these functions on the CGI side.

We also move some of the presentation code from hard-coded HTML to CSS,
for easier customization.

A side effect of the refactoring is that now localtime is always
displayed with the 'at night' warning.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit log: add '--merges' flag to match '--no-merges'
Linus Torvalds [Mon, 29 Jun 2009 17:28:25 +0000 (10:28 -0700)]
git log: add '--merges' flag to match '--no-merges'

I do various statistics on git, and one of the things I look at is merges,
because they are often interesting events to count ("how many merges vs
how much 'real development'" kind of statistics). And you can do it with
some fairly straightforward scripting, ie

git rev-list --parents HEAD |
grep ' .* ' |
git diff-tree --always -s --pretty=oneline --stdin |
less -S

will do it.

But I finally got irritated with the fact that we can skip merges with
'--no-merges', but we can't do the trivial reverse operation.

So this just adds a '--merges' flag that _only_ shows merges. Now you can
do the above with just a

git log --merges --pretty=oneline

which is a lot simpler. It also means that we automatically get a lot of
statistics for free, eg

git shortlog -ns --merges

does exactly what you'd want it to do.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoadd --porcelain option to git-push
Larry D'Anna [Tue, 23 Jun 2009 01:10:01 +0000 (21:10 -0400)]
add --porcelain option to git-push

If --porcelain is used git-push will produce machine-readable output.  The
output status line for each ref will be tab-separated and sent to stdout instead
of stderr.  The full symbolic names of the refs will be given.  For example

$ git push --dry-run --porcelain master :foobar 2>/dev/null \
  | perl -pe 's/\t/ TAB /g'

= TAB refs/heads/master:refs/heads/master TAB [up to date]
- TAB :refs/heads/foobar TAB [deleted]

Signed-off-by: Larry D'Anna <larry@elder-gods.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge git://git.bogomips.org/git-svn
Junio C Hamano [Sun, 28 Jun 2009 03:09:04 +0000 (20:09 -0700)]
Merge git://git.bogomips.org/git-svn

* git://git.bogomips.org/git-svn:
  git svn: Doc update for multiple branch and tag paths
  git svn: cleanup t9138-multiple-branches
  git-svn: Canonicalize svn urls to prevent libsvn assertion
  t9138: remove stray dot in test which broke bash
  git-svn: convert globs to regexps for branch destinations
  git svn: Support multiple branch and tag paths in the svn repository.
  Add 'git svn reset' to unwind 'git svn fetch'
  git-svn: speed up find_rev_before
  Add 'git svn help [cmd]' which works outside a repo.
  git-svn: let 'dcommit $rev' work on $rev instead of HEAD

15 years agogit svn: Doc update for multiple branch and tag paths
Marc Branchaud [Fri, 26 Jun 2009 20:49:19 +0000 (16:49 -0400)]
git svn: Doc update for multiple branch and tag paths

Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit svn: cleanup t9138-multiple-branches
Marc Branchaud [Fri, 26 Jun 2009 21:08:19 +0000 (17:08 -0400)]
git svn: cleanup t9138-multiple-branches

Using the "svn_cmd" wrapper instead of "svn" alone allows tests
to run consistently for users with customized
~/.subversion/configs.  Additionally, using subshells via
"(cd ...)" allow cleaner and less error-prone tests to
be written.

[ew: expanded commit message]

Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agoMerge branch 'pb/send-email-cccmd-fix'
Junio C Hamano [Sat, 27 Jun 2009 21:13:43 +0000 (14:13 -0700)]
Merge branch 'pb/send-email-cccmd-fix'

* pb/send-email-cccmd-fix:
  t/t9001-send-email.sh: ensure generated script is executed with $SHELL_PATH

15 years agoMerge branch 'maint'
Junio C Hamano [Sat, 27 Jun 2009 20:44:25 +0000 (13:44 -0700)]
Merge branch 'maint'

* maint:
  gitweb/README: fix AliasMatch in example
  Test grep --and/--or/--not
  Test git archive --remote
  fread does not return negative on error

15 years agogitweb/README: fix AliasMatch in example
Giuseppe Bilotta [Sat, 27 Jun 2009 16:24:11 +0000 (18:24 +0200)]
gitweb/README: fix AliasMatch in example

When combining "dumb client" and human-friendly access by using the
'.git' extension to switch between the two, make sure the AliasMatch
covers the entire request. Without a full match, a request for

http://git.example.com/project/shortlog/branch..gitsomething

would result in a 404 because the server would try to access the
the project 'project/shortlog/branch.'

The solution is still not bulletproof, so document the possible failing
case.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoTest grep --and/--or/--not
Thomas Rast [Sat, 27 Jun 2009 18:47:44 +0000 (20:47 +0200)]
Test grep --and/--or/--not

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoTest git archive --remote
Thomas Rast [Sat, 27 Jun 2009 18:47:43 +0000 (20:47 +0200)]
Test git archive --remote

Add a small test case for git archive --remote (and thus
git-upload-archive), which so far went untested.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUse die_errno() instead of die() when checking syscalls
Thomas Rast [Sat, 27 Jun 2009 15:58:47 +0000 (17:58 +0200)]
Use die_errno() instead of die() when checking syscalls

Lots of die() calls did not actually report the kind of error, which
can leave the user confused as to the real problem.  Use die_errno()
where we check a system/library call that sets errno on failure, or
one of the following that wrap such calls:

  Function              Passes on error from
  --------              --------------------
  odb_pack_keep         open
  read_ancestry         fopen
  read_in_full          xread
  strbuf_read           xread
  strbuf_read_file      open or strbuf_read_file
  strbuf_readlink       readlink
  write_in_full         xwrite

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoConvert existing die(..., strerror(errno)) to die_errno()
Thomas Rast [Sat, 27 Jun 2009 15:58:46 +0000 (17:58 +0200)]
Convert existing die(..., strerror(errno)) to die_errno()

Change calls to die(..., strerror(errno)) to use the new die_errno().

In the process, also make slight style adjustments: at least state
_something_ about the function that failed (instead of just printing
the pathname), and put paths in single quotes.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodie_errno(): double % in strerror() output just in case
Junio C Hamano [Sat, 27 Jun 2009 15:58:45 +0000 (17:58 +0200)]
die_errno(): double % in strerror() output just in case

[tr: handle border case where % is placed at end of buffer]

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoIntroduce die_errno() that appends strerror(errno) to die()
Thomas Rast [Sat, 27 Jun 2009 15:58:44 +0000 (17:58 +0200)]
Introduce die_errno() that appends strerror(errno) to die()

There are many calls to die() that do, or should, report
strerror(errno) to indicate how the syscall they guard failed.
Introduce a small helper function for this case.

Note:

- POSIX says vsnprintf can modify errno in some unlikely cases, so we
  have to use errno early.

- We take some care to pass the original format to die_routine(), in
  case someone wants to call die_errno() with custom format
  characters.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-svn: Canonicalize svn urls to prevent libsvn assertion
Ulrich Dangel [Fri, 26 Jun 2009 14:52:09 +0000 (16:52 +0200)]
git-svn: Canonicalize svn urls to prevent libsvn assertion

Cloning/initializing svn repositories with an uncanonicalize url
does not work as libsvn throws an assertion. This patch
canonicalize svn uris for the clone and init command from
git-svn.

[ew: fixed trailing whitespace]

Signed-off-by: Ulrich Dangel <uli@spamt.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agot9138: remove stray dot in test which broke bash
Eric Wong [Thu, 25 Jun 2009 23:09:59 +0000 (16:09 -0700)]
t9138: remove stray dot in test which broke bash

The stray dot broke bash and probably some other shells,
but worked fine with dash in my limited testing.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
15 years agogit-remote: fix missing .uploadpack usage for show command
Chris Frey [Thu, 25 Jun 2009 21:21:35 +0000 (17:21 -0400)]
git-remote: fix missing .uploadpack usage for show command

For users pulling from machines with self compiled git installs,
in non-PATH locations, they can set the config option
remote.<name>.uploadpack to set the location of git-upload-pack.

When using 'git remote show <name>', the remote HEAD check
did not use the uploadpack configuration setting, and would
not use the configured program.

In builtin-remote.c, the config setting is already loaded
with the call to remote_get(), so this patch passes that remote
along to transport_get().

Signed-off-by: Chris Frey <cdfrey@foursquare.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-svn: convert globs to regexps for branch destinations
Eric Wong [Thu, 25 Jun 2009 09:28:15 +0000 (02:28 -0700)]
git-svn: convert globs to regexps for branch destinations

Marc Branchaud wrote:
> I'm fairly happy with this, except for the way the branch
> subcommand matches refspecs.  The patch does a simple string
> comparison, but it'd be better to do an actual glob.  I just
> couldn't track down the right function for that, so I left it as
> a strcmp and hope that a gitizen can tell me how to glob here.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
15 years agogit svn: Support multiple branch and tag paths in the svn repository.
Marc Branchaud [Tue, 23 Jun 2009 17:02:08 +0000 (13:02 -0400)]
git svn: Support multiple branch and tag paths in the svn repository.

This enables git-svn.perl to read multiple 'branches' and 'tags' entries in
svn-remote config sections.  The init and clone subcommands also support
multiple --branches and --tags arguments.

The branch (and tag) subcommand gets a new argument: --destination (or -d).
This argument is required if there are multiple branches (or tags) entries
configured for the remote Subversion repository.  The argument's value
specifies which branch (or tag) path to use to create the branch (or tag).
The specified value must match the left side (without wildcards) of one of
the branches (or tags) refspecs in the svn-remote's config.

[ew: avoided explicit loop when combining globs with "push"]

Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agoAdd 'git svn reset' to unwind 'git svn fetch'
Ben Jackson [Thu, 4 Jun 2009 03:45:52 +0000 (20:45 -0700)]
Add 'git svn reset' to unwind 'git svn fetch'

Add a command to unwind the effects of fetch by moving the rev_map
and refs/remotes/git-svn back to an old SVN revision.  This allows
revisions to be re-fetched.  Ideally SVN revs would be immutable,
but permissions changes in the SVN repository or indiscriminate use
of '--ignore-paths' can create situations where fetch cannot make
progress.

Signed-off-by: Ben Jackson <ben@ben.com>
Acked-by: Eric Wong <normalperson@yhbt.net>