Commit graph

16007 commits

Author SHA1 Message Date
Todd Zullinger 18309f4c3e Use dashless git commands in setgitperms.perl
Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-22 09:36:12 -07:00
Johannes Sixt 79bbc7fb07 git-remote: do not use user input in a printf format string
'git remote show' substituted the remote name into a string that was later
used as a printf format string. If a remote name contains a printf format
specifier like this:

   $ git remote add foo%sbar .

then the command

   $ git remote show foo%sbar

would print garbage (if you are lucky) or crash. This fixes it.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-22 09:35:58 -07:00
Michael J Gruber 7d20e2189e make "git remote" report multiple URLs
This patch makes "git remote -v" and "git remote show" report multiple URLs
rather than warn about them. Multiple URLs are OK for pushing into
multiple repos simultaneously. Without "-v" each repo is shown once only.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-22 09:29:37 -07:00
Daniel Barkalow 352eadc400 Check early that a new branch is new and valid
If you fail to update refs to change branches in checkout, your index
and working tree are left already updated. We don't have an easy way
to undo this, but at least we can check things that would make the
creation of a new branch fail. These checks were in the shell version,
and were lost in the C conversion.

The messages are from the shell version, and should probably be made nicer.

[jc: added test to t7201]

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-21 23:17:06 -07:00
Junio C Hamano 96d1a8e9d4 diff hunk pattern: fix misconverted "\{" tex macro introducers
Pointed out by Brandon Casey.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-20 15:30:17 -07:00
Junio C Hamano 6a6baf9b4e diff: use extended regexp to find hunk headers
Using ERE elements such as "|" (alternation) by backquoting in BRE
is a GNU extension and should not be done in portable programs.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-19 23:45:04 -07:00
Junio C Hamano cc185a6a8a Start draft release notes for 1.6.0.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-19 23:15:13 -07:00
Mikael Magnusson 8d11fdeaf6 git-repack uses --no-repack-object, not --no-repack-delta.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-19 22:23:14 -07:00
Mikael Magnusson 597faa00fd Typo "bogos" in format-patch error message.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-19 22:05:42 -07:00
Fabrizio Chiarello 02ed24580e builtin-clone: fix typo
Signed-off-by: Fabrizio Chiarello <ponch@autistici.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-19 22:05:31 -07:00
Yann Dirson 264e0b9a3c Bust the ghost of long-defunct diffcore-pathspec.
This concept was retired by 77882f6 (Retire diffcore-pathspec.,
2006-04-10), more than 2 years ago.

Signed-off-by: Yann Dirson <ydirson@altern.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-19 19:48:30 -07:00
Eric Raible aa5735bed4 completion: git commit should list --interactive
Signed-off-by: Eric Raible <raible@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-19 19:47:36 -07:00
Brandon Casey 45d9414fa5 diff.*.xfuncname which uses "extended" regex's for hunk header selection
Currently, the hunk headers produced by 'diff -p' are customizable by
setting the diff.*.funcname option in the config file. The 'funcname' option
takes a basic regular expression. This functionality was designed using the
GNU regex library which, by default, allows using backslashed versions of
some extended regular expression operators, even in Basic Regular Expression
mode. For example, the following characters, when backslashed, are
interpreted according to the extended regular expression rules: ?, +, and |.
As such, the builtin funcname patterns were created using some extended
regular expression operators.

Other platforms which adhere more strictly to the POSIX spec do not
interpret the backslashed extended RE operators in Basic Regular Expression
mode. This causes the pattern matching for the builtin funcname patterns to
fail on those platforms.

Introduce a new option 'xfuncname' which uses extended regular expressions,
and advertise it _instead_ of funcname. Since most users are on GNU
platforms, the majority of funcname patterns are created and tested there.
Advertising only xfuncname should help to avoid the creation of non-portable
patterns which work with GNU regex but not elsewhere.

Additionally, the extended regular expressions may be less ugly and
complicated compared to the basic RE since many common special operators do
not need to be backslashed.

For example, the GNU Basic RE:

    ^[ 	]*\\(\\(public\\|static\\).*\\)$

becomes the following Extended RE:

    ^[ 	]*((public|static).*)$

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-18 20:06:31 -07:00
Brandon Casey a013585b20 diff.c: associate a flag with each pattern and use it for compiling regex
This is in preparation for allowing extended regular expression patterns.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-18 20:06:23 -07:00
Brandon Casey 45e7ca0f0e diff.c: return pattern entry pointer rather than just the hunk header pattern
This is in preparation for associating a flag with each pattern which will
control how the pattern is interpreted. For example, as a basic or extended
regular expression.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-18 19:58:29 -07:00
Junio C Hamano ea2408bfe1 Merge branch 'dp/maint-rebase-fix' into maint
* dp/maint-rebase-fix:
  git-rebase--interactive: auto amend only edited commit
  git-rebase-interactive: do not squash commits on abort
2008-09-18 19:53:25 -07:00
Junio C Hamano 2ba3d5d9bd Merge branch 'jc/maint-checkout-keep-remove' into maint
* jc/maint-checkout-keep-remove:
  checkout: do not lose staged removal
2008-09-18 19:53:22 -07:00
Junio C Hamano 01409bbf75 Merge branch 'jc/maint-diff-quiet' into maint
* jc/maint-diff-quiet:
  diff --quiet: make it synonym to --exit-code >/dev/null
  diff Porcelain: do not disable auto index refreshing on -C -C
2008-09-18 19:53:12 -07:00
Junio C Hamano a3fcc0562c Merge branch 'jc/maint-name-hash-clear' into maint
* jc/maint-name-hash-clear:
  discard_cache: reset lazy name_hash bit
2008-09-18 19:53:06 -07:00
Junio C Hamano f99b1d23bb Merge branch 'jc/maint-template-permbits' into maint
* jc/maint-template-permbits:
  Fix permission bits on sources checked out with an overtight umask
2008-09-18 19:53:01 -07:00
Junio C Hamano 6380d128ed Merge branch 'mh/maint-honor-no-ssl-verify' into maint
* mh/maint-honor-no-ssl-verify:
  Don't verify host name in SSL certs when GIT_SSL_NO_VERIFY is set
2008-09-18 19:52:57 -07:00
Thomas Rast e32c0a9c38 sha1_file: link() returns -1 on failure, not errno
5723fe7 (Avoid cross-directory renames and linking on object creation,
2008-06-14) changed the call to use link() directly instead of through a
custom wrapper, but forgot that it returns 0 or -1, not 0 or errno.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-18 19:51:13 -07:00
Charles Bailey b99b5b40cf Make git archive respect core.autocrlf when creating zip format archives
There is currently no call to git_config at the start of cmd_archive.
When creating tar archives the core config is read as a side-effect of
reading the tar specific config, but this doesn't happen for zip
archives.

The consequence is that in a configuration with core.autocrlf set,
although files in a tar archive are created with crlf line endings,
files in a zip archive retain unix line endings.

Signed-off-by: Charles Bailey <charles@hashpling.org>
Acked-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-18 19:49:28 -07:00
Charles Bailey f1265cc9ff Add new test to demonstrate git archive core.autocrlf inconsistency
Signed-off-by: Charles Bailey <charles@hashpling.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-18 19:49:06 -07:00
Joey Hess 53c3967647 gitweb: avoid warnings for commits without body
In the unusual case when there is no commit message, gitweb would
output an uninitialized value warning.

Signed-off-by: Joey Hess <joey@kitenet.net>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-18 19:48:19 -07:00
Garry Dolley c882c01ef9 Clarified gitattributes documentation regarding custom hunk header.
The only part of the hunk header that we can change is the "TEXT"
portion.  Additionally, a few grammatical errors have been corrected.

Signed-off-by: Garry Dolley <gdolley@ucla.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-18 19:44:47 -07:00
Eric Wong 61aeeefd29 git-svn: fix handling of even funkier branch names
Apparently do_switch() tolerates the lack of escaping in less
funky branch names.  For the really strange and scary ones, we
need to escape them properly.  It strangely maintains compatible
with the existing handling of branch names with spaces and
exclamation marks.

Reported-by: m.skoric@web.de ($gmane/94677)
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2008-09-18 19:27:16 -07:00
Alec Berryman ad0a82bae0 git-svn: Always create a new RA when calling do_switch for svn://
Not doing so caused the "Malformed network data" error when a directoy
was deleted and replaced with a copy from an older version.

Signed-off-by: Alec Berryman <alec@thened.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-18 19:21:40 -07:00
Alec Berryman dd9da51fe2 git-svn: factor out svnserve test code for later use
Signed-off-by: Alec Berryman <alec@thened.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-18 19:20:34 -07:00
Junio C Hamano 903e09a3ec diff/diff-files: do not use --cc too aggressively
Textual diff output for unmerged paths was too eager to give condensed
combined diff.  Even though "diff -c" (and "diff-files -c -p") is a
request to view combined diff without condensing (otherwise the user would
have explicitly asked for --cc, not -c), we showed "--cc" output anyway.

0fe7c1d (built-in diff: assorted updates, 2006-04-29) claimed to be
careful about doing this, but its breakage was hidden because back then
"git diff" was still a shell script that did not use the codepath it
introduced fully.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-18 10:49:03 -07:00
Heikki Orsila 1f5a892e52 Cosmetical command name fix
If we came from git.c the first arg would be "archive".
"git-archive" isn't a bug because cmd_archive() doesn't check
the first arg.

Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-15 23:11:35 -07:00
Heikki Orsila f18d244a63 Start conforming code to "git subcmd" style part 3
User notifications are presented as 'git cmd', and code comments
are presented as '"cmd"' or 'git's cmd', rather than 'git-cmd'.

Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-15 23:11:35 -07:00
Brandon Casey bf55778855 t9700/test.pl: remove File::Temp requirement
The object oriented version of File::Temp is a rather new incarnation it
seems. The File::Temp man page for v5.8.0 says "(NOT YET IMPLEMENTED)" in
the 'Objects' section. Instead of creating a file with a unique name in
the system TMPDIR, we can create our own temporary file with a static
name and use that instead.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Tested-by: Tom G. Christensen <tgc@statsbiblioteket.dk> on RHEL 3, Perl 5.8.0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-15 23:11:28 -07:00
Brandon Casey 8409bb3708 t9700/test.pl: avoid bareword 'STDERR' in 3-argument open()
Some versions of perl complain when 'STDERR' is used as the third argument
in the 3-argument form of open(). Convert to the 2-argument form which is
described for duping STDERR in my second edition camel book.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Tested-by: Tom G. Christensen <tgc@statsbiblioteket.dk> on RHEL 3, Perl 5.8.0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-15 23:10:23 -07:00
Junio C Hamano 97a7a82f19 GIT 1.6.0.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-12 16:18:47 -07:00
Junio C Hamano ce785c5944 Merge branch 'ho/maint-dashless' into maint
* ho/maint-dashless:
  Start conforming code to "git subcmd" style part 2
2008-09-12 16:15:23 -07:00
Ralf Wildenhues b66e00f12a Fix some manual typos.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-12 13:19:56 -07:00
Jeff King 06e75d9ac7 Use compatibility regex library also on FreeBSD
Commit 3632cfc24 makes the same change for Darwin; however, the problem
also exists on FreeBSD.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-11 09:44:28 -07:00
Johannes Sixt 9c101b3e6f Use compatibility regex library also on AIX
This augments 3632cfc24 (Use compatibility regex library on Darwin,
2008-09-07), which already carries a "Tested-by" statement for AIX,
but that test was actually done with this patch included.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Tested-by: Mike Ralphson <mike@abacus.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-11 01:23:16 -07:00
Junio C Hamano 873358dd2a Update draft release notes for 1.6.0.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-10 13:38:20 -07:00
Arjen Laarhoven 3632cfc248 Use compatibility regex library for OSX/Darwin
The standard libc regex library on OSX does not support alternation
in POSIX Basic Regular Expression mode.  This breaks the diff.funcname
functionality on OSX.

To fix this, we use the GNU regex library which is already present in
the compat/ diretory for the MinGW port.  However, simply adding compat/
to the COMPAT_CFLAGS variable causes a conflict between the system
fnmatch.h and the one present in compat/.  To remedy this, move the
regex and fnmatch functionality to their own subdirectories in compat/
so they can be included seperately.

Signed-off-by: Arjen Laarhoven <arjen@yaph.org>
Tested-by: Mike Ralphson <mike@abacus.co.uk> (AIX)
Tested-by: Johannes Sixt <johannes.sixt@telecom.at> (MinGW)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-10 13:36:40 -07:00
Marcus Griep 971e628384 git-svn: Fixes my() parameter list syntax error in pre-5.8 Perl
Signed-off-by: Marcus Griep <marcus@griep.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-10 11:47:06 -07:00
Marcus Griep 836ff95df6 Git.pm: Use File::Temp->tempfile instead of ->new
Perl 5.8.0 ships with File::Temp 0.13, which does not have the new()
interface introduced in 0.14, as pointed out by Tom G. Christensen.

This modifies Git.pm to use the more established tempfile() interface
and updates 'git svn' to match.

Signed-off-by: Marcus Griep <marcus@griep.us>
Acked-by: Eric Wong <normalperson@yhbt.net>
Tested-by: Tom G. Christensen <tgc@statsbiblioteket.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-10 11:45:22 -07:00
Miklos Vajna 1e368681bd t7501: always use test_cmp instead of diff
This should make the output more readable (by default using diff -u)
when some tests fail.

Also changed the diff order from "current expected" to "expected
current".

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-10 11:16:10 -07:00
Junio C Hamano a14f6ca26a Merge branch 'jc/maint-log-grep' into maint
* jc/maint-log-grep:
  log --author/--committer: really match only with name part
2008-09-10 02:15:08 -07:00
Junio C Hamano 26c10c7ad3 Merge branch 'jc/maint-hide-cr-in-diff-from-less' into maint
* jc/maint-hide-cr-in-diff-from-less:
  diff: Help "less" hide ^M from the output
2008-09-10 02:14:18 -07:00
Junio C Hamano 94c27881bd Merge branch 'jc/maint-checkout-fix' into maint
* jc/maint-checkout-fix:
  checkout: do not check out unmerged higher stages randomly
2008-09-10 02:13:41 -07:00
Junio C Hamano 9f35e5fd54 Merge branch 'np/maint-safer-pack' into maint
* np/maint-safer-pack:
  fixup_pack_header_footer(): use nicely aligned buffer sizes
  index-pack: use fixup_pack_header_footer()'s validation mode
  pack-objects: use fixup_pack_header_footer()'s validation mode
  improve reliability of fixup_pack_header_footer()
  pack-objects: improve returned information from write_one()
2008-09-10 02:12:47 -07:00
Junio C Hamano 5521883490 checkout: do not lose staged removal
The logic to checkout a different commit implements the safety to never
lose user's local changes.  For example, switching from a commit to
another commit, when you have changed a path that is different between
them, need to merge your changes to the version from the switched-to
commit, which you may not necessarily be able to resolve easily.  By
default, "git checkout" refused to switch branches, to give you a chance
to stash your local changes (or use "-m" to merge, accepting the risks of
getting conflicts).

This safety, however, had one deliberate hole since early June 2005.  When
your local change was to remove a path (and optionally to stage that
removal), the command checked out the path from the switched-to commit
nevertheless.

This was to allow an initial checkout to happen smoothly (e.g. an initial
checkout is done by starting with an empty index and switching from the
commit at the HEAD to the same commit).  We can tighten the rule slightly
to allow this special case to pass, without losing sight of removal
explicitly done by the user, by noticing if the index is truly empty when
the operation begins.

For historical background, see:

    http://thread.gmane.org/gmane.comp.version-control.git/4641/focus=4646

This case is marked as *0* in the message, which both Linus and I said "it
feels somewhat wrong but otherwise we cannot start from an empty index".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-09 22:55:22 -07:00
Junio C Hamano d8bdc49265 Fix permission bits on sources checked out with an overtight umask
Two patches 9907721 (templates/Makefile: don't depend on local umask
setting, 2008-02-28) and 96cda0b (templates/Makefile: install is
unnecessary, just use mkdir -p, 2008-08-21) tried to prevent an overtight
umask the builder/installer might have from screwing over the installation
procedure, but we forgot there was another source of trouble.  If the
person who checked out the source tree had an overtight umask, it will
leak out to the built products, which is propagated to the installation
destination.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-09 13:32:32 -07:00