Commit graph

22145 commits

Author SHA1 Message Date
Junio C Hamano aa8b12505b Merge branch 'mg/maint-send-email-lazy-editor'
* mg/maint-send-email-lazy-editor:
  send-email: lazily assign editor variable
2010-04-03 12:28:42 -07:00
Junio C Hamano 4de113cdf5 Merge branch 'rb/maint-python-path'
* rb/maint-python-path:
  Correct references to /usr/bin/python which does not exist on FreeBSD
2010-04-03 12:28:41 -07:00
Junio C Hamano 16b8a3e4b9 Merge branch 'jn/merge-diff3-label'
* jn/merge-diff3-label:
  merge-recursive: add a label for ancestor
  cherry-pick, revert: add a label for ancestor
  revert: clarify label on conflict hunks
  compat: add mempcpy()
  checkout -m --conflict=diff3: add a label for ancestor
  merge_trees(): add ancestor label parameter for diff3-style output
  merge_file(): add comment explaining behavior wrt conflict style
  checkout --conflict=diff3: add a label for ancestor
  ll_merge(): add ancestor label parameter for diff3-style output
  merge-file --diff3: add a label for ancestor
  xdl_merge(): move file1 and file2 labels to xmparam structure
  xdl_merge(): add optional ancestor label to diff3-style output
  tests: document cherry-pick behavior in face of conflicts
  tests: document format of conflicts from checkout -m

Conflicts:
	builtin/revert.c
2010-04-03 12:28:41 -07:00
Junio C Hamano 40a56f45bc Merge branch 'ef/cherry-abbrev'
* ef/cherry-abbrev:
  ls: remove redundant logic
  cherry: support --abbrev option
2010-04-03 12:28:40 -07:00
Junio C Hamano 0cb050abc2 Merge branch 'bw/template-tool-buildconfig'
* bw/template-tool-buildconfig:
  Modernize git calling conventions in hook templates
  Make templates honour SHELL_PATH and PERL_PATH
2010-04-03 12:28:40 -07:00
Junio C Hamano 59d1e01d69 Merge branch 'mg/mailmap-update'
* mg/mailmap-update:
  .mailmap: Entries for Alex Bennée, Deskin Miller, Vitaly "_Vi" Shukela
2010-04-03 12:28:40 -07:00
Junio C Hamano c2c6bcd3fa Merge branch 'bc/t5505-fix'
* bc/t5505-fix:
  t/t5505-remote.sh: escape * to prevent interpretation by shell as glob
  t5505: add missing &&
  t5505: remove unnecessary subshell invocations
2010-04-03 12:28:40 -07:00
Junio C Hamano f40805be21 Merge branch 'gh/maint-stash-show-error-message'
* gh/maint-stash-show-error-message:
  Improve error messages from 'git stash show'
2010-04-03 12:28:40 -07:00
Junio C Hamano 07b838f087 Merge branch 'rs/threaded-grep-context'
* rs/threaded-grep-context:
  grep: enable threading for context line printing

Conflicts:
	grep.c
2010-04-03 12:28:39 -07:00
Junio C Hamano d718dd0732 Merge branch 'bc/maint-daemon-sans-ss-family'
* bc/maint-daemon-sans-ss-family:
  daemon.c: avoid accessing ss_family member of struct sockaddr_storage
2010-04-03 12:28:39 -07:00
Junio C Hamano a59cb82a2f Merge branch 'bc/acl-test'
* bc/acl-test:
  t/t1304: make a second colon optional in the mask ACL check
  t/t1304: set the ACL effective rights mask
  t/t1304: use 'test -r' to test readability rather than looking at mode bits
  t/t1304: set the Default ACL base entries
  t/t1304: avoid -d option to setfacl
2010-04-03 12:28:39 -07:00
Junio C Hamano 8479c68799 Merge branch 'ja/send-email-ehlo'
* ja/send-email-ehlo:
  git-send-email.perl - try to give real name of the calling host to HELO/EHLO
  git-send-email.perl: add option --smtp-debug
  git-send-email.perl: improve error message in send_message()
2010-04-03 12:28:39 -07:00
Junio C Hamano df9930c129 Merge branch 'do/rebase-i-arbitrary'
* do/rebase-i-arbitrary:
  rebase--interactive: don't require what's rebased to be a branch

Conflicts:
	t/t3404-rebase-interactive.sh
2010-04-03 12:28:38 -07:00
Junio C Hamano 7135046b8b Merge branch 'ak/everyday-git'
* ak/everyday-git:
  everyday: fsck and gc are not everyday operations
2010-04-03 12:28:38 -07:00
Jonathan Nieder ecebd1e1a7 Makefile: future-proof Cygwin version check
Tweak the condition that detects old Cygwin versions to not include
versions such as 1.8, 1.11, and 2.1.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-03 11:26:35 -07:00
Markus Heidelberg b2f6fd9575 t7508: add a test for "git status" in a read-only repository
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-03 11:25:13 -07:00
Markus Heidelberg 4bb6644d03 git status: refresh the index if possible
This was already the case before commit 9e4b7ab6 (git status: not
"commit --dry-run" anymore, 2009-08-15) with the difference that it died
at failure.
It got lost during the new implementation of "git status", which was
meant to only change behaviour when invoked with arguments.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-02 21:25:59 -07:00
Markus Heidelberg 4c926b37c2 t7508: add test for "git status" refreshing the index
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-02 21:25:47 -07:00
YONETANI Tomokazu 6555b196f0 Fix _XOPEN_SOURCE problem on DragonFly
As on FreeBSD, defining _XOPEN_SOURCE to 600 on DragonFly BSD 2.4-RELEASE
or later hides symbols from programs, which leads to implicit declaration
of functions, making the return value to be assumed an int.  On architectures
where sizeof(int) < sizeof(void *), this can cause unexpected behaviors or
crashes.
This change won't affect other OSes unless they define __DragonFly__ macro,
or older versions of DragonFly BSD as the current git code doesn't rely on
the features only available with _XOPEN_SOURCE set to 600 on DragonFly.

Signed-off-by: YONETANI Tomokazu <y0netan1@dragonflybsd.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-02 21:24:30 -07:00
Mark Rada e3918594f6 gitweb: update INSTALL to use shorter make target
Gitweb can be generated by the gitweb/gitweb.cgi target or the gitweb
target. Since the gitweb target is shorter, I think it would be better
to have new users be instructed to use it.

Signed-off-by: Mark Rada <marada@uwaterloo.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-02 21:23:42 -07:00
Mark Rada a8ab675f21 gitweb: add documentation to INSTALL regarding gitweb.js
This patch updates gitweb/INSTALL to mention gitweb.js, including
JavaScript minification support.

Signed-off-by: Mark Rada <marada@uwaterloo.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-02 21:23:41 -07:00
Mark Rada 09b89d1a08 instaweb: add minification awareness
This patch will cause git-instaweb to use the minified version of gitweb
support files (e.g. CSS and JavaScript) if they were generated.

Without minification awareness, generating the minified version of
gitweb's support files will generate a broken instaweb script since the
copy of gitweb.cgi will look for gitweb.min.* which will not exist.

Signed-off-by: Mark Rada <marada@uwaterloo.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-02 21:23:40 -07:00
Mark Rada bb4bbf7582 Gitweb: add autoconfigure support for minifiers
This will allow users to set a JavaScript/CSS minifier when/if they run
the autoconfigure script while building git.

Signed-off-by: Mark Rada <marada@uwaterloo.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-02 21:23:38 -07:00
Mark Rada 0e6ce21361 Gitweb: add support for minifying gitweb.css
The build system added support minifying gitweb.js through a
JavaScript minifier, but most minifiers come with support for
minifying CSS files as well, so we should use it if we can.

This patch will add the same facilities to gitweb.css that
gitweb.js has for minification. That does not mean that they
will use the same minifier though, as it is not safe to assume
that all JavaScript minifiers will also minify CSS files.

This patch also adds the GITWEB_PROGRAMS variable to the Makefile
to keep a list of potential gitweb dependencies separate from
OTHER_PROGRAMS when we need to know just the gitweb dependencies.

Though the bandwidth savings will not be as dramatic as with
the JavaScript minifier, every byte saved is important.

Signed-off-by: Mark Rada <marada@uwaterloo.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-02 21:23:35 -07:00
Mark Rada 8830bf4bc5 Gitweb: add ignore and clean rules for minified files
Signed-off-by: Mark Rada <marada@uwaterloo.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-02 21:23:26 -07:00
Chris Webb 3e3ec2abe0 whitespace: add tab-in-indent error class
Some projects and languages use coding style where no tab character is used to
indent the lines.

This only adds support and documentation for "apply --whitespace=warn" and
"diff --check"; later patches add "apply --whitespace=fix" and tests.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-02 21:08:04 -07:00
Junio C Hamano 727c3718a5 whitespace: we cannot "catch all errors known to git" anymore
Traditionally, "*.txt whitespace" in .gitattributes file has been an
instruction to catch _all_ classes of whitespace errors known to git.

This has to change, however, in order to introduce "tab-in-indent" which
is inherently incompatible with "indent-with-non-tab".  As we do not want
to break configuration of existing users, add a mechanism to allow marking
selected rules to be excluded from "all rules known to git".

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-02 21:07:44 -07:00
Markus Heidelberg 1f2362a944 builtin/commit: remove unnecessary variable definition
The file descriptor is already defined at the beginning of the function.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-02 11:38:00 -07:00
Markus Heidelberg 7327623526 builtin/commit: fix duplicated sentence in a comment
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-02 11:37:03 -07:00
Eric Raymond 2c4dc02346 Integrate version 3 ciabot scripts into contrib/.
These have been extensively live-tested in the last week. The version 2
ciabot.sh maintainer has passed the baton to me; ciabot.py is original.

Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-02 09:19:17 -07:00
Jeff King b337398266 diff: avoid useless filespec population
builtin_diff calls fill_mmfile fairly early, which in turn
calls diff_populate_filespec, which actually retrieves the
file's blob contents into a buffer. Long ago, this was
sensible as we would need to look at the blobs eventually.

These days, however, we may not ever want those blobs if we
end up using a textconv cache, and for large binary files
(exactly the sort for which you might have a textconv
cache), just retrieving the objects can be costly.

This patch just pushes the fill_mmfile call a bit later, so
we can avoid populating the filespec in some cases.  There
is one thing to note that looks like a bug but isn't. We
push the fill_mmfile down into the first branch of a
conditional. It seems like we would need it on the other
branch, too, but we don't; fill_textconv does it for us (in
fact, before this, we were just writing over the results of
the fill_mmfile on that branch).

Here's a timing sample on a commit with 45 changed jpgs and
avis. The result is fully textconv cached, but we still
wasted a lot of time just pulling the blobs from storage.
The total size of the blobs (source and dest) is about
180M.

  [before]
  $ time git show >/dev/null
  real    0m0.352s
  user    0m0.148s
  sys     0m0.200s

  [after]
  $ time git show >/dev/null
  real    0m0.009s
  user    0m0.004s
  sys     0m0.004s

And that's on a warm cache. On a cold cache, the "after"
case is not much worse, but the "before" case has to do an
extra 180M of I/O.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-02 00:11:20 -07:00
Jeff King d9bae1a178 diff: cache textconv output
Running a textconv filter can take a long time. It's
particularly bad for a large file which needs to be spooled
to disk, but even for small files, the fork+exec overhead
can add up for something like "git log -p".

This patch uses the notes-cache mechanism to keep a fast
cache of textconv output. Caches are stored in
refs/notes/textconv/$x, where $x is the userdiff driver
defined in gitattributes.

Caching is enabled only if diff.$x.cachetextconv is true.

In my test repo, on a commit with 45 jpg and avi files
changed and a textconv to show their exif tags:

  [before]
  $ time git show >/dev/null
  real    0m13.724s
  user    0m12.057s
  sys     0m1.624s

  [after, first run]
  $ git config diff.mfo.cachetextconv true
  $ time git show >/dev/null
  real    0m14.252s
  user    0m12.197s
  sys     0m1.800s

  [after, subsequent runs]
  $ time git show >/dev/null
  real    0m0.352s
  user    0m0.148s
  sys     0m0.200s

So for a slight (3.8%) cost on the first run, we achieve an
almost 40x speed up on subsequent runs.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-02 00:05:31 -07:00
Jeff King 840383b2c2 textconv: refactor calls to run_textconv
This patch adds a fill_textconv wrapper, which centralizes
some minor logic like error checking and handling the case
of no-textconv.

In addition to dropping the number of lines, this will make
it easier in future patches to handle multiple types of
textconv.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-02 00:01:57 -07:00
Jeff King a941d5e395 introduce notes-cache interface
Notes provide a fast lookup mechanism for data keyed by
sha1. This is ideal for caching certain operations, like
textconv filters.

This patch builds some infrastructure to make it simpler to
use notes trees as caches. In particular, caches:

  1. don't have arbitrary commit messages. They store a
     cache validity string in the commit, and clear the tree
     when the cache validity string changes.

  2. don't keep any commit history. The accumulated history
     of a a cache is just useless cruft.

  3. use a looser form of locking for ref updates. If two
     processes try to write to the cache simultaneously, it
     is OK if one overwrites the other, losing some changes.
     It's just a cache, so we will just end up with an extra
     miss.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-01 23:58:30 -07:00
Jeff King 40d52ff77b make commit_tree a library function
Until now, this has been part of the commit-tree builtin.
However, it is already used by other builtins (like commit,
merge, and notes), and it would be useful to access it from
library code.

The check_valid helper has to come along, too, but is given
a more library-ish name of "assert_sha1_type".

Otherwise, the code is unchanged. There are still a few
rough edges for a library function, like printing the utf8
warning to stderr, but we can address those if and when they
come up as inappropriate.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-01 23:53:54 -07:00
Jeff King b76c056b95 fix textconv leak in emit_rewrite_diff
We correctly free() for the normal diff case, but leak for
rewrite diffs.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-01 23:49:29 -07:00
Jeff King c00e657df2 fix const-correctness of write_sha1_file
These should take const buffers as input data, but zlib's
next_in pointer is not const-correct. Let's fix it at the
zlib level, though, so the cast happens in one obvious
place. This should be safe, as a similar cast is used in
zlib's example code for a const array.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-01 23:49:03 -07:00
Eric Blake a50dec22f2 Makefile: update defaults for modern Cygwin
Now that Cygwin 1.7.x has enabled lots of new features, and Cygwin 1.5
is no longer actively supported by the Cygwin mailing lists, we might
as well update the defaults to cater to those new features.

NO_TRUSTABLE_FILEMODE is only necessary on FAT drives; the Cygwin
community recommends NTFS drives, but there is still too much use
for FAT to switch the default.  Likewise, UNRELIABLE_FSTAT is probably
file-system specific, but worth keeping unchanged.

This commit does not change the default for NO_MMAP, although definitive
proof of whether this option is necessary is lacking.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-01 23:43:16 -07:00
Scott Chacon 42653c09c8 Prompt for a username when an HTTP request 401s
When an HTTP request returns a 401, Git will currently fail with a
confusing message saying that it got a 401, which is not very
descriptive.

Currently if a user wants to use Git over HTTP, they have to use one
URL with the username in the URL (e.g. "http://user@host.com/repo.git")
for write access and another without the username for unauthenticated
read access (unless they want to be prompted for the password each
time). However, since the HTTP servers will return a 401 if an action
requires authentication, we can prompt for username and password if we
see this, allowing us to use a single URL for both purposes.

This patch changes http_request to prompt for the username and password,
then return HTTP_REAUTH so http_get_strbuf can try again.  If it gets
a 401 even when a user/pass is supplied, http_request will now return
HTTP_NOAUTH which remote_curl can then use to display a more
intelligent error message that is less confusing.

Signed-off-by: Scott Chacon <schacon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-01 23:24:59 -07:00
Christian Couder 91e5259896 revert: add "--strategy" option to choose merge strategy
This patch makes it possible to use a different merge strategy when
cherry-picking. This is usefull mainly for debugging purposes as it
allows to see if some failures are caused by the merge strategy used or
not.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-01 11:14:11 -07:00
Christian Couder c674d05273 merge: make function try_merge_command non static
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-01 11:14:10 -07:00
Christian Couder 3f9083cde3 merge: refactor code that calls "git merge-STRATEGY"
In the try_merge_strategy() function, when the strategy is "recursive"
or "subtree", the merge_recursive() function is called.
Otherwise we launch a "git merge-STRATEGY" process.

To make it possible to reuse code that launches a "git merge-STRATEGY"
process, this patch refactors this code into a new try_merge_command()
function.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-01 11:14:10 -07:00
Christian Couder ae8c79fd8f revert: refactor merge recursive code into its own function
The code that is used to do a recursive merge is extracted from
the revert_or_cherry_pick() function and put into a new
do_recursive_merge() function.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-01 11:14:10 -07:00
Christian Couder bc84a7fbac revert: use strbuf to refactor the code that writes the merge message
The code in this commit was written by Stephan Beyer for the sequencer
GSoC project:

    git://repo.or.cz/git/sbeyer.git

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-01 11:14:09 -07:00
Sverre Rabbelier 7aeaa2fc0a remote-helpers: add testgit helper
Currently the remote helper infrastructure is only used by the curl
helper, which does not give a good impression of how remote helpers
can be used to interact with foreign repositories. Since implementing
such a helper is non-trivial it would be good to have at least one
easy-to-follow example demonstrating how to implement a helper that
interacts with a foreign vcs using fast-import/fast-export.

The testgit helper can be used to interact with remote git
repositories by prefixing the url with "testgit::".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-31 21:40:16 -07:00
Sverre Rabbelier 73b49a7592 remote-helpers: add support for an export command
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-31 21:40:11 -07:00
Junio C Hamano 890a13a452 Sync with 1.7.0.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-31 15:14:27 -07:00
Junio C Hamano 2be10bb5c1 Git 1.7.0.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-31 15:12:08 -07:00
Junio C Hamano 970957dbad Merge branch 'jc/maint-refs-dangling' into maint
* jc/maint-refs-dangling:
  refs: ref entry with NULL sha1 is can be a dangling symref
2010-03-31 15:09:32 -07:00
Holger Weiß 4318d3ba8f Documentation: show-ref <pattern>s are optional
Specifying one or more <pattern> parameters is optional when calling
show-ref, so mark them as such using brackets in the manual.

Signed-off-by: Holger Weiß <holger@zedat.fu-berlin.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-31 14:22:17 -07:00