Commit graph

19896 commits

Author SHA1 Message Date
Junio C Hamano d68fe26f3e diff --whitespace: fix blank lines at end
The earlier logic tried to colour any and all blank lines that were added
beyond the last blank line in the original, but this was very wrong.  If
you added 96 blank lines, a non-blank line, and then 3 blank lines at the
end, only the last 3 lines should trigger the error, not the earlier 96
blank lines.

We need to also make sure that the lines are after the last non-blank line
in the postimage as well before deciding to paint them.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-14 22:18:36 -07:00
Junio C Hamano 2b621c1a3a Merge branch 'maint'
* maint:
  http.c: avoid freeing an uninitialized pointer
2009-09-14 14:48:27 -07:00
Junio C Hamano 4197ce3c6d Merge branch 'rc/maint-http-no-head-pack-check' into maint
* rc/maint-http-no-head-pack-check:
  http.c: avoid freeing an uninitialized pointer
2009-09-14 14:48:20 -07:00
Junio C Hamano b2025146d0 http.c: avoid freeing an uninitialized pointer
An earlier 59b8d38 (http.c: remove verification of remote packs) left
the variable "url" uninitialized; "goto cleanup" codepath can free it
which is not very nice.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-14 14:48:15 -07:00
Heiko Voigt 20f34902d1 web--browse: fix Mac OS X GUI detection for 10.6
Since OS X 10.6 the variable $SECURITYSESSIONID does not exist anymore,
so lets look for the $TERM_PROGRAM variable as backup.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-14 02:27:25 -07:00
Heiko Voigt 39c448c19d remove logical typo in documentation of sample update hook
Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-14 02:23:49 -07:00
Nicolas Pitre 03aa8ff3be Nicolas Pitre has a new email address
Due to problems at cam.org, my nico@cam.org email address is no longer
valid.  From now on, nico@fluxnic.net should be used instead.

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-14 02:23:36 -07:00
Dmitry Potapov 0f4b377c20 git-archive: infer output format from filename when unspecified
A command line

    $ git archive -o my-v2.0.zip v2.0

almost certainly wants the output in zip format, even though it does not
specify any --format option.

When --format is not given, but output filename is, try to infer what
format is requested from the filename extension.  Currently this code only
knows about '.zip'.  When the format is unspecified and the filename does
not tell us, the output will be in 'tar' format as before.

Of course, an explicit --format will not trigger this guesswork.

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-13 13:54:39 -07:00
Todd Zullinger 518ef8f07f completion: Replace config --list with --get-regexp
James Bardin noted that the completion spewed warnings when no git config
file is present.  This is likely a bug to be fixed in git config, but it's
also good to simplify the completion code by using the --get-regexp option
as Jeff King pointed out.

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Trivially-acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-13 13:40:25 -07:00
Dmitry Potapov 05d3951ec9 git-archive: add '-o' as a alias for '--output'
The '-o' option is commonly used in many tools to specify the output file.
Typing '--output' every time is a bit too long to be a practical alternative
to redirecting output. But specifying the output name has the advantage of
making possible to guess the desired output format by filename extension.

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-13 13:23:40 -07:00
Clemens Buchacher 98df233e2d test local clone by copying
Test the effect of an earlier change by f7835a2 (preserve mtime of local
clone, 2009-09-12) to keep stale loose object files stale in the new
repository when a local clone is made by copying files in .git/
directory.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-13 13:22:29 -07:00
Johannes Gilger 65d15ed992 git-clone doc: typofix
Signed-off-by: Johannes Gilger <heipei@hackvalue.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-13 11:58:54 -07:00
Nelson Elhage 9f67fee2f0 git-push: Accept -n as a synonym for --dry-run.
git-push is not currently using -n for anything else, and it seems
unlikely we will want to use it to mean anything else in the future,
so add it as an alias for convenience.

Signed-off-by: Nelson Elhage <nelhage@mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-13 11:29:18 -07:00
Junio C Hamano 12efe45a33 git-commit doc: remove duplicated --dry-run description
60c2993 (Documentation/git-commit.txt: describe --dry-run, 2009-08-15)
wanted to update the documentation to say that "git status" is not the
same as "git commit --dry-run" anymore, but it screwed up and also added
the description of --dry-run that was already present.

Noticed by Johannes Gilger.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-13 11:24:26 -07:00
Junio C Hamano eaf1c941bb GIT 1.6.5-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-13 01:50:33 -07:00
Jari Aalto 5f2b1e67ca Improve --patch option documentation in git-add
Signed-off-by: Jari Aalto <jari.aalto@cante.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-13 01:36:13 -07:00
Junio C Hamano 4a452ede39 Merge branch 'pk/fast-import-tars'
* pk/fast-import-tars:
  import-tars: Allow per-tar author and commit message.
2009-09-13 01:33:29 -07:00
Junio C Hamano d821c003f8 Merge branch 'pk/fast-import-dirs'
* pk/fast-import-dirs:
  Add script for importing bits-and-pieces to Git.
2009-09-13 01:33:26 -07:00
Junio C Hamano 79cb645f9a Merge branch 'jt/pushinsteadof'
* jt/pushinsteadof:
  Add url.<base>.pushInsteadOf: URL rewriting for push only
  Wrap rewrite globals in a struct in preparation for adding another set
2009-09-13 01:33:20 -07:00
Junio C Hamano dc1b0c06ee Merge branch 'jk/unwanted-advices'
* jk/unwanted-advices:
  status: make "how to stage" messages optional
  push: make non-fast-forward help message configurable
2009-09-13 01:33:18 -07:00
Junio C Hamano 8b54f63dce Merge branch 'jc/merge-saner-messages'
* jc/merge-saner-messages:
  merge-recursive: give less scary messages when merge did not start
2009-09-13 01:33:15 -07:00
Junio C Hamano 1cdd64e800 quiltimport documentation: --dry-run and -n are synonyms
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-13 01:32:49 -07:00
Clemens Buchacher f7835a251c preserve mtime of local clone
A local clone without hardlinks copies all objects, including dangling
ones, to the new repository. Since the mtimes are renewed, those
dangling objects cannot be pruned by "git gc --prune", even if they
would have been old enough for pruning in the original repository.

Instead, preserve mtime during copy. "git gc --prune" will then work
in the clone just like it did in the original.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-13 01:32:26 -07:00
Jim Meyering 41698375ad don't dereference NULL upon fdopen failure
There were several unchecked use of fdopen(); replace them with xfdopen()
that checks and dies.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-13 01:32:20 -07:00
Jim Meyering 3d913526b1 use write_str_in_full helper to avoid literal string lengths
This is the same fix to use write_str_in_full() helper to write a constant
string out without counting the length of it ourselves.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-13 01:32:04 -07:00
Junio C Hamano cd03eebbfd Merge branch 'db/vcs-helper'
* db/vcs-helper:
  Makefile: remove remnant of separate http/https/ftp helpers
  Use a clearer style to issue commands to remote helpers
  Make the "traditionally-supported" URLs a special case
  Makefile: install hardlinks for git-remote-<scheme> supported by libcurl if possible
  Makefile: do not link three copies of git-remote-* programs
  Makefile: git-http-fetch does not need expat
  http-fetch: Fix Makefile dependancies
  Add transport native helper executables to .gitignore
  git-http-fetch: not a builtin
  Use an external program to implement fetching with curl
  Add support for external programs for handling native fetches
2009-09-13 01:31:55 -07:00
Jim Meyering 2b7ca830c6 use write_str_in_full helper to avoid literal string lengths
In 2d14d65 (Use a clearer style to issue commands to remote helpers,
2009-09-03) I happened to notice two changes like this:

-	write_in_full(helper->in, "list\n", 5);
+
+	strbuf_addstr(&buf, "list\n");
+	write_in_full(helper->in, buf.buf, buf.len);
+	strbuf_reset(&buf);

IMHO, it would be better to define a new function,

    static inline ssize_t write_str_in_full(int fd, const char *str)
    {
           return write_in_full(fd, str, strlen(str));
    }

and then use it like this:

-       strbuf_addstr(&buf, "list\n");
-       write_in_full(helper->in, buf.buf, buf.len);
-       strbuf_reset(&buf);
+       write_str_in_full(helper->in, "list\n");

Thus not requiring the added allocation, and still avoiding
the maintenance risk of literal string lengths.
These days, compilers are good enough that strlen("literal")
imposes no run-time cost.

Transformed via this:

    perl -pi -e \
        's/write_in_full\((.*?), (".*?"), \d+\)/write_str_in_full($1, $2)/'\
      $(git grep -l 'write_in_full.*"')

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-13 01:31:10 -07:00
Matthieu Moy 511a3fc116 wrap git's main usage string.
It's now similar wrapped the same way as in Documentation/git.txt, and
fits in a 67 characters wide terminal.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-13 01:31:02 -07:00
Junio C Hamano 5b590d783a Merge branch 'maint'
* maint:
  GIT 1.6.4.3
  svn: properly escape arguments for authors-prog
  http.c: remove verification of remote packs
  grep: accept relative paths outside current working directory
  grep: fix exit status if external_grep() punts

Conflicts:
	GIT-VERSION-GEN
	RelNotes
2009-09-13 01:30:53 -07:00
Junio C Hamano 7fb6bcff2d GIT 1.6.4.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-13 01:28:13 -07:00
Mark Lodato d3d7d47e6e svn: properly escape arguments for authors-prog
Previously, the call to authors-prog was not properly escaped, so any
special characters in the Subversion username, such as spaces and
semi-colons, would be interpreted by the shell rather than being passed
in as the first argument.  Now all unsafe characters are escaped using
"git rev-parse --sq-quote"

[ew: switched from "\Q..\E" to "rev-parse --sq-quote"]

Signed-off-by: Mark Lodato <lodatom@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-13 01:28:07 -07:00
Junio C Hamano 45c58ba00a Merge branch 'cb/maint-1.6.3-grep-relative-up' into maint
* cb/maint-1.6.3-grep-relative-up:
  grep: accept relative paths outside current working directory
  grep: fix exit status if external_grep() punts

Conflicts:
	t/t7002-grep.sh
2009-09-13 01:24:20 -07:00
Junio C Hamano 85cdaa468d Makefile: remove remnant of separate http/https/ftp helpers
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-11 22:35:30 -07:00
Jeff King 0c3d3ac352 rebase: use plumbing to show dirty state
Commit 4cfbe06 introduced the use of "git diff" to show
dirty state in a format more familiar to users. However, it
should have used the plumbing "git diff-files" instead.

Not only is it good practice in general to use plumbing in
scripts, but in this case we really don't want the automatic
pager to kick in for an error message.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-11 21:41:15 -07:00
Jeff King edf563fbaa status: make "how to stage" messages optional
These messages are nice for new users, but experienced git
users know how to manipulate the index, and these messages
waste a lot of screen real estate.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-11 21:33:24 -07:00
Jeff King 75194438f4 push: make non-fast-forward help message configurable
This message is designed to help new users understand what
has happened when refs fail to push. However, it does not
help experienced users at all, and significantly clutters
the output, frequently dwarfing the regular status table and
making it harder to see.

This patch introduces a general configuration mechanism for
optional messages, with this push message as the first
example.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-11 21:33:20 -07:00
Johannes Sixt 25fc1786ab pager: set LESS=FRSX also on Windows
Previously, this environment variable was set in the pager_preexec
callback, which is conditionally-compiled only on Unix, because it is not,
and cannot be, called on Windows.

With this patch the env member of struct child_process is used to set
the environment variable, which also works on Windows.

Noticed by Alexey Borzenkov.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-11 16:35:08 -07:00
Johannes Sixt 2affea4125 start_command: do not clobber cmd->env on Windows code path
Previously, it would not be possible to call start_command twice for the
same struct child_process that has env set.

The fix is achieved by moving the loop that modifies the environment block
into a helper function. This also allows us to make two other helper
functions static.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-11 16:33:54 -07:00
Tay Ray Chuan 59b8d38f6e http.c: remove verification of remote packs
Make http.c::fetch_pack_index() no longer check for the remote pack
with a HEAD request before fetching the corresponding pack index file.

Not only does sending a HEAD request before we do a GET incur a
performance penalty, it does not offer any significant error-
prevention advantages (pack fetching in the *_http_pack_request()
methods is capable of handling any errors on its own).

This addresses an issue raised elsewhere:

  http://code.google.com/p/msysgit/issues/detail?id=323
  http://support.github.com/discussions/repos/957-cant-clone-over-http-or-git

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-11 01:45:36 -07:00
Nicolas Sebrecht 434a6db7dc add documentation for mailinfo.scissors and '--no-scissors'
Signed-off-by: Nicolas Sebrecht <nicolas.s.dev@gmx.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-11 00:23:07 -07:00
Nicolas Sebrecht e019961d7f mailinfo: add '--scissors' to usage message
Signed-off-by: Nicolas Sebrecht <nicolas.s.dev@gmx.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-11 00:11:44 -07:00
Brian Gernhardt 5beb577db8 INSTALL: Describe dependency knobs from Makefile
We said that some of our dependencies were optional, but didn't say
how to turn them off.  Add information for that and mention where to
save the options close to the top of the file.

Also, standardize on both using quotes for the names of the dependencies
and tabs for indentation of the list.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-10 21:34:43 -07:00
Brian Gernhardt 26d9443925 INSTALL: Reorder dependencies, split shell and Perl
The most important and non-optional dependencies should go first, so put
them there.  While we're moving them, the descriptions for shell and perl
were archaic, referring to "bare-bones Porcelainish scripts" that have
become powerful and essential.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-10 21:34:36 -07:00
Reilly Grant 1d7367dce7 git-p4: Avoid modules deprecated in Python 2.6.
The popen2, sha and sets modules are deprecated in Python 2.6 (sha in
Python 2.5).  Both popen2 and sha are not actually used in git-p4.
Replace usage of sets.Set with the builtin set object.

The built-in set object was added in Python 2.4 and is already used in
other parts of this script, so this dependency is nothing new.

Signed-off-by: Reilly Grant <reillyeon@qotw.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-10 11:22:22 -07:00
Brian Gernhardt 0460dba4b4 Makefile: Add NEEDS_CRYPTO_WITH_SSL
The Makefile comment for NEEDS_SSL_WITH_CRYPTO says to define it "if
you need -lcrypto with -lssl (Darwin)."  However, what it actually
does is add -lssl when you use -lcrypto and not the other way around.
However, libcrypto contains a majority of the ERR_* functions from
OpenSSL (at least on OS X) so we need it both ways.

So, add NEEDS_CRYPTO_WITH_SSL which adds -lcrypto to the OpenSSL link
flags and clarify the difference between it and NEEDS_SSL_WITH_CRYPTO.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-10 10:22:05 -07:00
Paul Mackerras c21398be6d gitk: Show diff of commits at end of compare-commits output
When comparing a string of commits, when we find two non-merge commits
that differ, we now write the two commits to files and diff the files.
This pulls out the logic for creating a temporary directory from
external_diff into a separate procedure so that the new diffcommits
procedure can use it.

Because the diff command returns an exit status of 1 when the files
differ, and Tcl treats that as an error, this adds catch {} around the
close statements in getblobdiffline.

At present this only removes the temporary files when gitk exits.  It
should remove them when the diff is done.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2009-09-10 21:46:28 +10:00
Martin Nordholts aaa68dd50f git.el: Use git-add-file for unmerged files, remove git-resolve-file
Use `git-add-file' to mark unmerged files as resolved in the
*git-status* buffer to be consistent with git's CLI instructions. Also
remove `git-resolve-file' to make it clear that that "R" is a now a
free keybinding.

Signed-off-by: Martin Nordholts <martinn@src.gnome.org>
Acked-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-09 12:11:44 -07:00
Brian Gernhardt 3de8ba0217 INSTALL: Update description of our SHA-1 code
We haven't had Mozilla's code or an ARM optimized algorithm since
30ae47b.  Reword the paragraph to give credit but not authorship to
Mozilla.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-08 23:32:43 -07:00
Junio C Hamano fadd069d03 merge-recursive: give less scary messages when merge did not start
When unpack_trees() three-way merge logic is called from merge-recursive
and finds that local changes are going to be clobbered, its plumbing level
messages were given as errors first, and then the merge driver added even
more scary message "fatal: merging of trees <a long object name> and
<another long object name> failed".

This is most often encountered by new CVS/SVN migrants who are used to
start a merge from a dirty work tree.  The saddest part is that the merge
refused to run to prevent _any_ damage from being done to your work tree
when these messages are given, but the messages look a lot more scarier
than the conflicted case where the user needs to resolve them.

Replace the plumbing level messages so that they talk about what it is
protecting the user from, and end the messages with "Aborting." so that it
becomes clear that the command did not do any harm.

The final "merging of trees failed" message is superfluous, unless you are
interested in debugging the merge-recursive itself.  Squelch the current
die() message by default, but allow it to help people who debug git with
verbosity level 4 or greater.

Unless there is some bug, an inner merge that does not touch working tree
should not trigger any such error, so emit the current die() message when
we see an error return from it while running the inner merge, too.  It
would also help people who debug git.

We could later add instructions on how to recover (i.e. "stash changes
away or commit on a side branch and retry") instead of the silent
exit(128) I have in this patch, and then use Peff's advice.* mechanism to
squelch it (e.g. "advice.mergeindirtytree"), but they are separate topics.

Tested-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-08 14:46:36 -07:00
Josh Triplett 1c2eafb89b Add url.<base>.pushInsteadOf: URL rewriting for push only
This configuration option allows systematically rewriting fetch-only URLs
to push-capable URLs when used with push.  For instance:

[url "ssh://example.org/"]
    pushInsteadOf = "git://example.org/"

This will allow clones of "git://example.org/path/to/repo" to subsequently
push to "ssh://example.org/path/to/repo", without manually configuring
pushurl for that remote.

Includes documentation for the new option, bash completion updates, and
test cases (both that pushInsteadOf applies to push, that it does not
apply to fetch, and that it is ignored when pushURL is already defined).

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-09-08 01:18:46 -07:00