Commit graph

10950 commits

Author SHA1 Message Date
Johannes Schindelin 4d87b9c5db launch_editor(): Heed GIT_EDITOR and core.editor settings
In the commit 'Add GIT_EDITOR environment and core.editor
configuration variables', this was done for the shell scripts.
Port it over to builtin-tag's version of launch_editor(), which
is just about to be refactored into editor.c.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-21 16:51:14 -07:00
Carlos Rica 62e09ce998 Make git tag a builtin.
This replaces the script "git-tag.sh" with "builtin-tag.c".

The existing test suite for "git tag" guarantees the compatibility
with the features provided by the script version.

There are some minor changes in the behaviour of "git tag" here:
"git tag -v" now can get more than one tag to verify, like "git tag -d" does,
"git tag" with no arguments prints all tags, more like "git branch" does,
and "git tag -n" also prints all tags with annotations (without needing -l).
Tests and documentation were also updated to reflect these changes.

The program is currently calling the script "git verify-tag" for verify.
This can be changed porting it to C and calling its functions directly
from builtin-tag.c.

Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-20 01:27:25 -07:00
Jakub Narebski 69a9b41c15 gitweb cleanup: Move @diff_opts declaration earlier
Move @diff_opts declaration earlier, so that all gitweb options are
together (and not separated by %feature hash and some subroutines),
with the exception of $GITWEB_CONFIG which must be after all option
variables including %feature hash.

While at it, in the moved comment, note that diff option '-C' implies
'-M', instead of suggesting that '-M', '-C' is required.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-20 01:21:06 -07:00
Adam Roben ef0c2abf3e Add GIT_EDITOR environment and core.editor configuration variables
These variables let you specify an editor that will be launched in
preference to the EDITOR and VISUAL environment variables. The order
of preference is GIT_EDITOR, core.editor, EDITOR, VISUAL.

[jc: added a test and config variable documentation]

Signed-off-by: Adam Roben <aroben@apple.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-20 00:46:34 -07:00
Steven Grimm a7738c77f1 Document how to tell git to not launch a pager
Signed-off-by: Steven Grimm <koreth@midwinter.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-20 00:01:26 -07:00
Carlos Rica c4fba0a358 Rename read_pipe() with read_fd() and make its buffer nul-terminated.
The new name is closer to the purpose of the function.

A NUL-terminated buffer makes things easier when callers need that.
Since the function returns only the memory written with data,
almost always allocating more space than needed because final
size is unknown, an extra NUL terminating the buffer is harmless.
It is not included in the returned size, so the function
remains working as before.

Also, now the function allows the buffer passed to be NULL at first,
and alloc_nr is now used for growing the buffer, instead size=*2.

Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-18 17:30:03 -07:00
Junio C Hamano 6fb73e442a Merge branch 'master' of git://people.freedesktop.org/~hausmann/git-p4
* 'master' of git://people.freedesktop.org/~hausmann/git-p4:
  git-p4: Cleanup, used common function for listing imported p4 branches
  git-p4: Fix upstream branch detection for submit/rebase with multiple branches.
  git-p4: Cleanup, make listExistingP4Branches a global function for later use.
  git-p4: input to "p4 files" by stdin instead of arguments
  git-p4: use subprocess in p4CmdList
2007-07-18 17:23:03 -07:00
Johannes Schindelin af580e9c5a filter-branch: get rid of "set -e"
It was reported by Alex Riesen that "set -e" can break something as
trivial as "unset CDPATH" in bash.

So get rid of "set -e".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-18 17:07:46 -07:00
Richard MUSIL 575d025c0d git-svn: Minimalistic patch which allows svn usernames with space(s).
Changed filter for username in svn-authors file, so even 'user name' is accepted.

Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-18 17:01:10 -07:00
Linus Torvalds b59d398bea Do a better job at guessing unknown character sets
At least in the kernel development community, we're generally slowly
converting to UTF-8 everywhere, and the old default of Latin1 in emails is
being supplanted by UTF-8, and it doesn't necessarily show up as such in
the mail headers (because, quite frankly, when people send patches
around, they want the email client to do as little as humanly possible
about the patch)

Despite that, it's often the case that email addresses etc still have
Latin1, so I've seen emails where this is a mixed bag, with Signed-off
parts being copied from email (and containing Latin1 characters), and the
rest of the email being a patch in UTF-8.

So this suggests a very natural change: if the target character set is
utf-8 (the default), and if the source already looks like utf-8, just
assume that it doesn't need any conversion at all.

Only assume that it needs conversion if it isn't already valid utf-8, in
which case we (for historical reasons) will assume it's Latin1.

Basically no really _valid_ latin1 will ever look like utf-8, so while
this changes our historical behaviour, it doesn't do so in practice, and
makes the default behaviour saner for the case where the input was already
in proper format.

We could do a more fancy guess, of course, but this correctly handled a
series of patches I just got from Andrew that had a mixture of Latin1 and
UTF-8 (in different emails, but without any character set indication).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-18 17:01:10 -07:00
しらいしななこ ec96e0f6a4 Document "git stash message..."
The command was recently updated to take message on the command line, but
this feature has not been documented.

Signed-off-by: Nanako Shiraishi <nanako3@bluebottle.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-18 17:01:10 -07:00
Sven Verdoolaege 0cf7375542 unpack-trees.c: assume submodules are clean during check-out
In particular, when moving back to a commit without a given submodule
and then moving back forward to a commit with the given submodule,
we shouldn't complain that updating would lose untracked file in
the submodule, because git currently does not checkout subprojects
during superproject check-out.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-18 17:01:00 -07:00
Junio C Hamano c1c10a3f27 Merge branch 'maint'
* maint:
  Force listingblocks to be monospaced in manpages
  Do not expect unlink(2) to fail on a directory.
2007-07-18 17:00:36 -07:00
Julian Phillips 281a53bb79 Force listingblocks to be monospaced in manpages
For the html output we can use a stylesheet to make sure that the
listingblocks are presented in a monospaced font.  For the manpages do
it manually by inserting a ".ft C" before and ".ft" after the block in
question.

In order for these roff commands to get through to the manpage they
have to be element encoded to prevent quoting.

Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-18 16:56:20 -07:00
Simon Hausmann 144ff46b19 git-p4: Cleanup, used common function for listing imported p4 branches
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-07-18 17:29:38 +02:00
Simon Hausmann 86506fe54c git-p4: Fix upstream branch detection for submit/rebase with multiple branches.
Don't use git name-rev to locate the upstream git-p4 branch for rebase and submit but instead locate the branch by comparing the depot paths.
name-rev may produce results like wrongbranch~12 as it uses the first match.

Signed-off-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
2007-07-18 17:29:31 +02:00
Simon Hausmann 062410bb9d git-p4: Cleanup, make listExistingP4Branches a global function for later use.
Signed-off-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
2007-07-18 17:29:05 +02:00
Junio C Hamano fa2e71c9e7 Do not expect unlink(2) to fail on a directory.
When "git checkout-index" checks out path A/B/C, it makes sure A
and A/B are truly directories; if there is a regular file or
symlink at A, we prefer to remove it.

We used to do this by catching an error return from mkdir(2),
and on EEXIST did unlink(2), and when it succeeded, tried
another mkdir(2).

Thomas Glanzmann found out the above does not work on Solaris
for a root user, as unlink(2) was so old fashioned there that it
allowed to unlink a directory.

As pointed out, this still doesn't guarantee that git won't call
"unlink()" on a directory (race conditions etc), but that's
fundamentally true (there is no "funlink()" like there is
"fstat()"), and besides, that is in no way git-specific (ie it's
true of any application that gets run as root).

Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-18 00:53:09 -07:00
Junio C Hamano 726f9bced9 Update INSTALL
We haven't used bignum in rev-list from openssl nor elsewhere
for a long time.  Also git-gui is now part of git.git itself,
and depends on wish.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-17 01:33:04 -07:00
Scott Lamb 788001908c git-p4: input to "p4 files" by stdin instead of arguments
This approach, suggested by Alex Riesen, bypasses the need for xargs-style
argument list handling. The handling in question looks broken in a corner
case with SC_ARG_MAX=4096 and final argument over 96 characters.

Signed-off-by: Scott Lamb <slamb@slamb.org>
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-07-17 08:35:33 +02:00
Scott Lamb 9f90c7335e git-p4: use subprocess in p4CmdList
This allows bidirectional piping - useful for "-x -" to avoid commandline
arguments - and is a step toward bypassing the shell.

Signed-off-by: Scott Lamb <slamb@slamb.org>
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-07-17 08:35:24 +02:00
Francis Moreau 33b1f3d544 Fix git-branch documentation when using remote refs
Signed-off-by: Francis Moreau <francis.moro@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-16 21:34:44 -07:00
Eric Wong 29633bb91c git-svn: fix commiting renames over DAV with funky file names
Renaming files with non-URI friendly characters caused
breakage when committing to DAV repositories (over http(s)).

Even if I try leaving out the $self->{url} from the return value
of url_path(), a partial (without host), unescaped path name
does not work.

Filenames for DAV repos need to be URI-encoded before being
passed to the library.  Since this bug did not affect file://
and svn:// repos, the git-svn test library needed to be expanded
to include support for starting Apache with mod_dav_svn enabled.

This new test is not enabled by default, but can be enabled by
setting SVN_HTTPD_PORT to any available TCP/IP port on
127.0.0.1.

Additionally, for running this test, the following variables
(with defaults shown) can be changed for the suitable system.
The default values are set for Debian systems:

  SVN_HTTPD_MODULE_PATH=/usr/lib/apache2/modules
  SVN_HTTPD_PATH=/usr/sbin/apache2

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-15 22:35:09 -07:00
David Kastrup 99c01de402 contrib/emacs/Makefile: Also install .el files.
Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-15 20:21:51 -07:00
Junio C Hamano 9dfdf14b38 GIT v1.5.3-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-15 16:41:17 -07:00
Sean e3b4968f9c Demote git-p4import to contrib status.
Move git-p4import.py and Documentation/git-p4import.txt into
a contrib/p4import directory.   Add a README there directing
people to contrib/fast-import/git-p4 as a better alternative.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-15 15:23:37 -07:00
Sean 21ad54467a Remove p4 rpm from git.spec.in.
Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-15 15:23:36 -07:00
Sean f979492354 Remove "WITH_P4IMPORT" knob from the Makefile
Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-15 15:23:36 -07:00
Jim Meyering a5e407988b git-cvsserver: detect/diagnose write failure, etc.
There were many operations that did not notice and report errors
to the CVS client, which would have resulted in corrupt working
tree.

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-14 23:33:22 -07:00
Emil Medve 4cb08df553 Use $(RM) in Makefiles instead of 'rm -f'
Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-14 23:31:01 -07:00
Junio C Hamano 3f2fd36ebc Merge branch 'master' of git://repo.or.cz/git/fastimport
* 'master' of git://repo.or.cz/git/fastimport:
  Teach fast-import to recursively copy files/directories
  Fix git-p4 on Windows to not use the Posix sysconf function.
  Correct trivial typo in fast-import documentation
2007-07-14 22:57:47 -07:00
Junio C Hamano a82830a457 Documentation/git-commit-tree: remove description of a nonexistent limitation
Noticed by Geoff Richards.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-14 22:56:47 -07:00
Peter Hagervall baffc0e770 Make every builtin-*.c file #include "builtin.h"
Make every builtin-*.c file #include "builtin.h".

Also takes care of some declaration/definition mismatches.

Signed-off-by: Peter Hagervall <hager@cs.umu.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-14 22:44:09 -07:00
Shawn O. Pearce b6f3481bb4 Teach fast-import to recursively copy files/directories
Some source material (e.g. Subversion dump files) perform directory
renames by telling us the directory was copied, then deleted in the
same revision.  This makes it difficult for a frontend to convert
such data formats to a fast-import stream, as all the frontend has
on hand is "Copy a/ to b/; Delete a/" with no details about what
files are in a/, unless the frontend also kept track of all files.

The new 'C' subcommand within a commit allows the frontend to make a
recursive copy of one path to another path within the branch, without
needing to keep track of the individual file paths.  The metadata
copy is performed in memory efficiently, but is implemented as a
copy-immediately operation, rather than copy-on-write.

With this new 'C' subcommand frontends could obviously implement an
'R' (rename) on their own as a combination of 'C' and 'D' (delete),
but since we have already offered up 'R' in the past and it is a
trivial thing to keep implemented I'm not going to deprecate it.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-15 01:41:23 -04:00
Marius Storm-Olsen 48b4c3d5ab Fix git-p4 on Windows to not use the Posix sysconf function.
Add condition for Windows, since it doesn't support the os.sysconf module.
We hardcode the commandline limit to 2K, as that should work on most
Windows platforms.

Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Acked-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-14 22:47:14 -04:00
Eric Wong 46cf98baa5 git-svn: remove leading slashes from fetch lines in the generate config
We were previously sensitive to leading slashes in the fetch
lines and incorrectly writing them to the config if the user
used them (needlessly) in the command-line.

This fixes the issue and allows us to play nicely with legacy
configs that have leading slashes in fetch lines.

Thanks to Bradford Smith for figuring this out for me:
>
> This works:
>
> git-svn clone https://my.server.net/repos/path/ -Ttrunk/testing
>   -ttags/testing -bbranches/testing testing
>
> This doesn't:
>
> git-svn clone https://my.server.net/repos/path -T/trunk/testing
>   -t/tags/testing -b/branches/testing testing

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-14 13:47:08 -07:00
Junio C Hamano 9400893171 Update .mailmap
The script "contrib/stats/mailmap.pl" found a few missed ones.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-14 13:44:58 -07:00
Junio C Hamano af6861b144 Add contrib/stats/mailmap.pl script
This script reads the existing commit log and .mailmap file,
and outputs author e-mail addresses that would map to more
than one names (most likely due to difference in the way they
are spelled, but some are due to ancient botched commits).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-14 13:43:49 -07:00
Josh Triplett 9d6f220cc8 Remove useless uses of cat, and replace with filename arguments
Replace uses of cat that do nothing but writing the contents of
a single file to another command via pipe.

[jc: Original patch from Josh was somewhat buggy and rewrote
"cat $file | wc -l" to "wc -l $file", but this one should be Ok.]

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-14 01:07:44 -07:00
Matthieu Moy bdecd9d41b More permissive "git-rm --cached" behavior without -f.
In the previous behavior, "git-rm --cached" (without -f) had the same
restriction as "git-rm". This forced the user to use the -f flag in
situations which weren't actually dangerous, like:

$ git add foo           # oops, I didn't want this
$ git rm --cached foo   # back to initial situation

Previously, the index had to match the file *and* the HEAD. With
--cached, the index must now match the file *or* the HEAD. The behavior
without --cached is unchanged, but provides better error messages.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-13 23:52:46 -07:00
Junio C Hamano 1701872fc2 Document new --date=<format>
Now, git-log family can take full range of internally supported date format
to their --date=<format> argument.  Document it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-13 23:48:03 -07:00
Junio C Hamano b727a235a7 Wire new date formats to --date=<format> parser.
Now we can use all internally supported date formats with

	git log --date=<format>

syntax.  Earlier, we only allowed relative/local/default.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-13 23:22:52 -07:00
Junio C Hamano 73013afd14 Make show_rfc2822_date() just another date output format.
These days, show_date() takes a date_mode parameter to specify
the output format, and a separate specialized function for dates
in E-mails does not make much sense anymore.

This retires show_rfc2822_date() function and make it just
another date output format.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-13 23:14:52 -07:00
Robin Rosenberg ee8f838e03 Support output ISO 8601 format dates
Support output of full ISO 8601 style dates in e.g. git log
and other places that use interpolation for formatting.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-13 22:47:49 -07:00
Junio C Hamano d60a6a662f Merge branch 'master' of git://git.kernel.org/pub/scm/gitk/gitk
* 'master' of git://git.kernel.org/pub/scm/gitk/gitk:
  gitk: Fix bug introduced by previous commit
2007-07-13 22:37:42 -07:00
Alex Riesen 793ad04198 Fix git-rebase -i to allow squashing of fast-forwardable commits
Without this change the commits will be left standalone, with
duplicated commit message.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-13 22:33:16 -07:00
Sven Verdoolaege 9a4cbdca34 lockfile.c: schedule remove_lock_file only once.
Removing a lockfile once should be enough.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-13 08:55:15 -07:00
Stephen Rothwell 689b4d552b send-email: discard blank around address in extract_valid_address as well.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-13 08:54:06 -07:00
Greg KH b06c6bc831 make git-send-email.perl handle email addresses with no names when Email::Valid is present
When using git-send-email.perl on a changeset that has:
	Cc: <stable@kernel.org>
in the body of the description, and the Email::Valid perl module is
installed on the system, the email address will be deemed "invalid" for
some reason (Email::Valid isn't smart enough to handle this?) and
complain and not send the address the email.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-12 22:48:54 -07:00
Paul Mackerras 6ebedabf2d gitk: Fix bug introduced by previous commit
When I added the "--" case to the code scanning the arguments, I missed
the fact that since the switch statement uses -regexp, the "--" case
will match any argument containing "--", e.g. "--all".  This fixes it
by taking out the -regexp (since we don't actually need regular
expression matching) and adjusting the match strings.

A side effect of this is that previously any argument starting with
"-d" would be taken to indicate date mode; now the argument has to be
exactly "-d" if you want date mode.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-07-13 13:45:55 +10:00