Commit graph

16038 commits

Author SHA1 Message Date
Jeff King 0e214af9c3 Makefile: do not set NEEDS_LIBICONV for Solaris 8
This breaks my build on Solaris 8, as there is no separate
libiconv.

The history of this line is somewhat convoluted. In 2fd955c
(in November 2005), NEEDS_LIBICONV was turned on for all
Solaris builds, claiming to "fix an error in Solaris 10 by
setting NEEDS_LIBICONV".

Later, e15f545 (in February of 2006) claimed that "Solaris
9+ don't need iconv", and moved NEEDS_LIBICONV into a
section for Solaris 8.

Furthermore, Brandon Casey claims in

<5A1KxlhmUIHe8iXPxnXYuNXsq0Yjlbwkz2eBin3z7ELuL9nK-4tSpw@cipher.nrlssc.navy.mil>

that he does not set NEEDS_LIBICONV for Solaris 7.

So either one of those commits is totally wrong, or there is
some other magic going on where some Solaris installs need
it and others don't.

Given Brandon's statement and my problems on Solaris 8 with
NEEDS_LIBICONV, I am inclined to think the first commit was
bogus, and that NEEDS_LIBICONV shouldn't be set for Solaris
at all by default. If somebody wants to use iconv and has
installed it manually, they can set it in their config.mak.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-03 07:51:54 -07:00
SZEDER Gábor 943cea9014 rebase -i: remove leftover debugging
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-03 07:43:28 -07:00
SZEDER Gábor 7c4188360a rebase -i: proper prepare-commit-msg hook argument when squashing
One would expect that the prepare-commit-msg hook gets 'squash' as the
second argument when squashing commits with 'rebase -i'.  However,
that was not the case, as it got 'merge' instead.  This patch fixes
the problem.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-02 19:23:55 -07:00
Jakub Narebski 9a1fd653b1 gitweb: Add path_info tests to t/t9500-gitweb-standalone-no-errors.sh
Note that those tests only check that there are no errors nor
warnings from Perl; they do not check for example if gitweb doesn't
use ARRAY(0x8e3cc20) instead of correct value in links, etc.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-02 17:44:09 -07:00
Jakub Narebski 2d7a3532c7 gitweb: Fix two 'uninitialized value' warnings in git_tree()
If we did try to access nonexistent directory or file, which means
that git_get_hash_by_path() returns `undef`, uninitialized $hash
variable was passed to 'open' call.  Now we fail early with "404 Not
Found - No such tree" error.  (If we try to access something which
does not resolve to tree-ish, for example a file / 'blob' object, the
error will be caught later, as "404 Not Found - Reading tree failed"
error).

If we tried to use 'tree' action without $file_name ('f' parameter)
set, which means either tree given by hash or a top tree (and we
currently cannot distinguish between those two cases), we cannot print
path breadcrumbs with git_print_page_path().  Fix this by moving call
to git_print_page_path() inside conditional.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-02 17:43:18 -07:00
David Soria Parra 6e2dfb1631 Solaris: Use OLD_ICONV to avoid compile warnings
Solaris systems use the old styled iconv(3) call and therefore
the OLD_ICONV variable should be set. Otherwise we get annoying compile
warnings.

Signed-off-by: David Soria Parra <dsp@php.net>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-02 17:27:31 -07:00
Giuseppe Bilotta b65910fec2 gitweb: remove PATH_INFO from $my_url and $my_uri
This patch fixes PATH_INFO handling by removing the relevant part from
$my_url and $my_uri, thus making it unnecessary to specify them by hand
in the gitweb configuration.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-02 17:27:10 -07:00
martin f. krafft b1524ee0f3 Improve git-log documentation wrt file filters
The need for "--" in the git-log synopsis was previously unclear and
confusing. This patch makes it a little clearer.

Thanks to hyy <yiyihu@gmail.com> for his help.

[sp: Changed -- to \-- per prior commit e1ccf53.]

Signed-off-by: martin f. krafft <madduck@madduck.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-01 08:21:22 -07:00
SZEDER Gábor 5d6b3a9ef8 Documentation: remove '\' in front of short options
... because they show up in the man and html outputs.

This escaping is only needed for double dashes to be compatible with
older asciidoc versions;  see commit e1ccf53 ([PATCH] Escape asciidoc's
built-in em-dash replacement, 2005-09-12).

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-01 08:18:46 -07:00
Luc Heinrich 0a1a1c8615 git-svn: call 'fatal' correctly in set-tree
When doing a set-tree and there is no revision to commit to, the following unrelated error message is displayed: "Undefined subroutine &Git::SVN::fatal called at /opt/local/libexec/git-core/git-svn line 2575." The following patch fixes the problem and allows the real error message to be shown.

Signed-off-by: Luc Heinrich <luc@honk-honk.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-30 13:58:59 -07:00
Michael Prokop 2670ddce53 Replace svn.foo.org with svn.example.com in git-svn docs (RFC 2606)
foo.org is an existing domain, use RFC 2606 complying example.com instead
as used in other docs as well.

Signed-off-by: Michael Prokop <mika@grml.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-30 13:57:47 -07:00
SZEDER Gábor 4b3729e637 t0024: add executable permission
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-30 12:16:59 -07:00
Shawn O. Pearce edb7e82f72 Merge branch 'bc/maint-diff-hunk-header-fix' into maint
* bc/maint-diff-hunk-header-fix:
  t4018-diff-funcname: test syntax of builtin xfuncname patterns
  diff hunk pattern: fix misconverted "\{" tex macro introducers
  diff: use extended regexp to find hunk headers
  diff.*.xfuncname which uses "extended" regex's for hunk header selection
  diff.c: associate a flag with each pattern and use it for compiling regex
  diff.c: return pattern entry pointer rather than just the hunk header pattern

Conflicts:
	Documentation/gitattributes.txt
2008-09-29 10:23:19 -07:00
Shawn O. Pearce e9a06f1eeb Merge branch 'mg/maint-remote-fix' into maint
* mg/maint-remote-fix:
  make "git remote" report multiple URLs
2008-09-29 09:39:53 -07:00
Rafael Garcia-Suarez cbce6c0be3 Clarify commit error message for unmerged files
Currently, trying to use git-commit with unmerged files in the index
will show the message "Error building trees", which can be a bit
obscure to the end user. This patch makes the error message clearer, and
consistent with what git-write-tree reports in a similar situation.

Signed-off-by: Rafael Garcia-Suarez <rgarciasuarez@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-29 09:13:20 -07:00
Johan Herland 94e02e7f3b Use strchrnul() instead of strchr() plus manual workaround
Also gets rid of a C++ comment.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-29 08:56:26 -07:00
Alex Riesen 175a494823 Use remove_path from dir.c instead of own implementation
Besides, it fixes a memleak (builtin-rm.c) and accidental change of
the input const argument (builtin-merge-recursive.c).

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-29 08:37:07 -07:00
Alex Riesen 4a92d1bfb7 Add remove_path: a function to remove as much as possible of a path
The function has two potential users which both managed to get wrong
their implementations (the one in builtin-rm.c one has a memleak, and
builtin-merge-recursive.c scribles over its const argument).

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-29 08:37:07 -07:00
Ping Yin b9b378a001 git-submodule: Fix "Unable to checkout" for the initial 'update'
Since commit 55218("checkout: do not lose staged removal"), in
cmd_add/cmd_update, "git checkout <commit>" following
"git clone -n" may fail if <commit> is different from HEAD.

So Use "git checkout -f <commit>" to fix this.

Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-29 08:24:19 -07:00
Stephen Haberman 2a79d2f662 Clarify how the user can satisfy stash's 'dirty state' check.
Signed-off-by: Stephen Haberman <stephen@exigencecorp.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-29 08:13:10 -07:00
Alex Riesen 41f13af558 Remove empty directories in recursive merge
The code was actually supposed to do that, but was accidentally broken.
Noticed by Anders Melchiorsen.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-26 08:05:20 -07:00
Chris Frey fee75457fc Documentation: clarify the details of overriding LESS via core.pager
The process of overriding the default LESS options using only
git-specific methods is rather obscure.  Show the end user how
to do it in a step-by-step manner.

Signed-off-by: Chris Frey <cdfrey@foursquare.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-26 07:55:30 -07:00
Gustaf Hendeby dd87558f58 git-gui: Help identify aspell version on Windows too
On windows, git gui fails to correctly extract the aspell version
(experienced with aspell version 0.50.3) due to scilent white space at
the end of the version string.  Trim the obtained version string to
work around this.

Signed-off-by: Gustaf Hendeby <hendeby@isy.liu.se>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-26 07:07:34 -07:00
Shawn O. Pearce 93feb4bb14 Update release notes for 1.6.0.3
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-25 08:27:41 -07:00
Jonas Fonseca 7fe4a728a1 checkout: Do not show local changes when in quiet mode
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-25 07:46:59 -07:00
Johan Herland 85cf643f1b for-each-ref: Fix --format=%(subject) for log message without newlines
'git for-each-ref --format=%(subject)' currently returns an empty string
if the log message does not contain a newline.

This patch teaches 'git for-each-ref' to return the entire log message
(instead of an empty string) if there is no newline in the log message.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-24 17:02:05 -07:00
Brandon Casey da65e7c133 git-stash.sh: don't default to refs/stash if invalid ref supplied
apply_stash() and show_stash() each call rev-parse with
'--default refs/stash' as an argument. This option causes rev-parse to
operate on refs/stash if it is not able to successfully operate on any
element of the command line. This includes failure to supply a "valid"
revision. This has the effect of causing 'stash apply' and 'stash show'
to operate as if stash@{0} had been supplied when an invalid revision is
supplied.

e.g. 'git stash apply stash@{1}' would fall back to
     'git stash apply stash@{0}'

This patch modifies these two functions so that they avoid using the
--default option of rev-parse.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-24 09:24:20 -07:00
Deskin Miller dc4179f9a7 maint: check return of split_cmdline to avoid bad config strings
As the testcase demonstrates, it's possible for split_cmdline to return -1 and
deallocate any memory it's allocated, if the config string is missing an end
quote.  In both the cases below, which are the only calling sites, the return
isn't checked, and using the pointer causes a pretty immediate segfault.

Signed-off-by: Deskin Miller <deskinm@umich.edu>
Acked-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-24 08:58:14 -07:00
Brandon Casey db87e3960c builtin-prune.c: prune temporary packs in <object_dir>/pack directory
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-23 01:53:07 -07:00
Brandon Casey e3bf5e43fd t4018-diff-funcname: test syntax of builtin xfuncname patterns
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-22 19:59:23 -07:00
Petr Baudis 8b4eb6b6cd Do not perform cross-directory renames when creating packs
A comment on top of create_tmpfile() describes caveats ('can have
problems on various systems (FAT, NFS, Coda)') that should apply
in this situation as well.  This in the end did not end up solving
any of my personal problems, but it might be a useful cleanup patch
nevertheless.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-22 12:19:14 -07:00
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