Commit graph

28085 commits

Author SHA1 Message Date
Junio C Hamano 1dcfa8de7c Merge branch 'mp/make-cleanse-x-for-exe' into maint
* mp/make-cleanse-x-for-exe:
  Explicitly set X to avoid potential build breakage
2012-02-13 23:26:25 -08:00
Junio C Hamano 42e283a1bf Merge branch 'jn/merge-no-edit-fix' into maint
* jn/merge-no-edit-fix:
  merge: do not launch an editor on "--no-edit $tag"
2012-02-13 23:24:02 -08:00
Jeff King a0b676aaee diff-highlight: document some non-optimal cases
The diff-highlight script works on heuristics, so it can be
wrong. Let's document some of the wrong-ness in case
somebody feels like working on it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-13 15:57:07 -08:00
Jeff King 34d9819e0a diff-highlight: match multi-line hunks
Currently we only bother highlighting single-line hunks. The
rationale was that the purpose of highlighting is to point
out small changes between two similar lines that are
otherwise hard to see. However, that meant we missed similar
cases where two lines were changed together, like:

   -foo(buf);
   -bar(buf);
   +foo(obj->buf);
   +bar(obj->buf);

Each of those changes is simple, and would benefit from
highlighting (the "obj->" parts in this case).

This patch considers whole hunks at a time. For now, we
consider only the case where the hunk has the same number of
removed and added lines, and assume that the lines from each
segment correspond one-to-one. While this is just a
heuristic, in practice it seems to generate sensible
results (especially because we now omit highlighting on
completely-changed lines, so when our heuristic is wrong, we
tend to avoid highlighting at all).

Based on an original idea and implementation by Michał
Kiedrowicz.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-13 15:57:06 -08:00
Jeff King 6463fd7ed1 diff-highlight: refactor to prepare for multi-line hunks
The current code structure assumes that we will only look at
a pair of lines at any given time, and that the end result
should always be to output that pair. However, we want to
eventually handle multi-line hunks, which will involve
collating pairs of removed/added lines. Let's refactor the
code to return highlighted pairs instead of printing them.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-13 15:57:06 -08:00
Jeff King 097128d1bc diff-highlight: don't highlight whole lines
If you have a change like:

  -foo
  +bar

we end up highlighting the entirety of both lines (since the
whole thing is changed). But the point of diff highlighting
is to pinpoint the specific change in a pair of lines that
are mostly identical. In this case, the highlighting is just
noise, since there is nothing to pinpoint, and we are better
off doing nothing.

The implementation looks for "interesting" pairs by checking
to see whether they actually have a matching prefix or
suffix that does not simply consist of colorization and
whitespace.  However, the implementation makes it easy to
plug in other heuristics, too, like:

  1. Depending on the source material, the set of "boring"
     characters could be tweaked to include language-specific
     stuff (like braces or semicolons for C).

  2. Instead of saying "an interesting line has at least one
     character of prefix or suffix", we could require that
     less than N percent of the line be highlighted.

The simple "ignore whitespace, and highlight if there are
any matched characters" implemented by this patch seems to
give good results on git.git. I'll leave experimentation
with other heuristics to somebody who has a dataset that
does not look good with the current code.

Based on an original idea and implementation by Michał
Kiedrowicz.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-13 15:57:06 -08:00
Jeff King 2b21008d3c diff-highlight: make perl strict and warnings fatal
These perl features can catch bugs, and we shouldn't be
violating any of the strict rules or creating any warnings,
so let's turn them on.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-13 15:57:06 -08:00
Zbigniew Jędrzejewski-Szmek ad6c3739a3 pager: find out the terminal width before spawning the pager
term_columns() checks for terminal width via ioctl(2) on the standard
output, but we spawn the pager too early for this check to be useful.

The effect of this buglet can be observed by opening a wide terminal and
running "git -p help --all", which still shows 80-column output, while
"git help --all" uses the full terminal width. Run the check before we
spawn the pager to fix this.

While at it, move term_columns() to pager.c and export it from cache.h so
that callers other than the help subsystem can use it.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-13 15:08:47 -08:00
Clemens Buchacher ef7e93d908 do not override receive-pack errors
Receive runs rev-list --verify-objects in order to detect missing
objects. However, such errors are ignored and overridden later.
Instead, consequently ignore all update commands for which an error has
already been detected.

Some tests in t5504 are obsoleted by this change, because invalid
objects are detected even if fsck is not enabled. Instead, they now test
for different error messages depending on whether or not fsck is turned
on. A better fix would be to force a corruption that will be detected by
fsck but not by rev-list.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-13 13:29:08 -08:00
Clemens Buchacher d202a513a4 t5541: check error message against the real port number used
Otherwise the test cannot be run with custom port set to LIB_HTTPD_PORT.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-13 13:25:40 -08:00
Clemens Buchacher 01fdc21f6e push/fetch/clone --no-progress suppresses progress output
By default, progress output is disabled if stderr is not a terminal.
The --progress option can be used to force progress output anyways.
Conversely, --no-progress does not force progress output. In particular,
if stderr is a terminal, progress output is enabled.

This is unintuitive. Change --no-progress to force output off.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-13 13:06:53 -08:00
Clemens Buchacher cb8da70547 git rev-list: fix invalid typecast
git rev-list passes rev_list_info, not rev_list objects. Without this
fix, rev-list enables or disables the --verify-objects option depending
on a read from an undefined memory location.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-13 12:49:15 -08:00
Junio C Hamano 6f5e880c68 Sync with maint
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-13 11:48:00 -08:00
Junio C Hamano 58d4203aa6 Update draft release notes to 1.7.9.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-13 11:46:47 -08:00
Junio C Hamano 4daf6fc837 Merge branch 'js/add-e-submodule-fix' into maint
* js/add-e-submodule-fix:
  add -e: do not show difference in a submodule that is merely dirty
2012-02-13 11:42:18 -08:00
Junio C Hamano 87cb3b82a4 Merge branch 'jc/parse-date-raw' into maint
* jc/parse-date-raw:
  parse_date(): '@' prefix forces git-timestamp
  parse_date(): allow ancient git-timestamp
2012-02-13 11:42:15 -08:00
Junio C Hamano 5a62b531ae Merge branch 'jc/merge-ff-only-stronger-than-signed-merge' into maint
* jc/merge-ff-only-stronger-than-signed-merge:
  merge: do not create a signed tag merge under --ff-only option
2012-02-13 11:42:11 -08:00
Junio C Hamano 8eb865ba8a Merge branch 'jc/branch-desc-typoavoidance' into maint
* jc/branch-desc-typoavoidance:
  branch --edit-description: protect against mistyped branch name
  tests: add write_script helper function
2012-02-13 11:42:07 -08:00
Junio C Hamano a78f5582fc Merge branch 'jn/rpm-spec' into maint
* jn/rpm-spec:
  git.spec: Workaround localized messages not put in any RPM
2012-02-13 11:42:04 -08:00
Ramsay Jones 0975a5020e builtin/tag.c: Fix a sparse warning
In particular, sparse complains as follows:

        SP builtin/tag.c
    builtin/tag.c:411:5: warning: symbol 'parse_opt_points_at' was \
        not declared. Should it be static?

In order to suppress the warning, since the parse_opt_points_at()
function does not need to be an external symbol, we simply add the
static modifier to the function definition.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-13 11:12:36 -08:00
Ævar Arnfjörð Bjarmason 1f5ad6b1a7 t: use sane_unset instead of unset
Change several tests to use the sane_unset function introduced in
v1.7.3.1-35-g00648ba instead of the built-in unset function.

This fixes a failure I was having on t9130-git-svn-authors-file.sh on
Solaris, and prevents several other issues from occurring.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-13 02:29:15 -08:00
Ævar Arnfjörð Bjarmason d24fbca7a5 Remove Git's support for smoke testing
I'm no longer running the Git smoke testing service at
smoke.git.nix.is due to Smolder being a fragile piece of software not
having time to follow through on making it easy for third parties to
run and submit their own smoke tests.

So remove the support in Git for sending smoke tests to
smoke.git.nix.is, it's still easy to modify the test suite to submit
smokes somewhere else.

This reverts the following commits:

    Revert "t/README: Add SMOKE_{COMMENT,TAGS}= to smoke_report target" -- e38efac87d
    Revert "t/README: Document the Smoke testing" -- d15e9ebc5c
    Revert "t/Makefile: Create test-results dir for smoke target" -- 617344d77b
    Revert "tests: Infrastructure for Git smoke testing" -- b6b84d1b74

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-13 02:29:07 -08:00
Ævar Arnfjörð Bjarmason 6d62c983f7 Makefile: Change the default compiler from "gcc" to "cc"
Ever since the very first commit to git.git we've been setting CC to
"gcc". Presumably this is behavior that Linus copied from the Linux
Makefile.

However unlike Linux Git is written in ANSI C and supports a multitude
of compilers, including Clang, Sun Studio, xlc etc. On my Linux box
"cc" is a symlink to clang, and on a Solaris box I have access to "cc"
is Sun Studio's CC.

Both of these are perfectly capable of compiling Git, and it's
annoying to have to specify CC=cc on the command-line when compiling
Git when that's the default behavior of most other portable programs.

So change the default to "cc". Users who want to compile with GCC can
still add "CC=gcc" to the make(1) command-line, but those users who
don't have GCC as their "cc" will see expected behavior, and as a
bonus we'll be more likely to smoke out new compilation warnings from
our distributors since they'll me using a more varied set of compilers
by default.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-13 02:28:54 -08:00
Дилян Палаузов b5225286b2 Makefile: introduce CHARSET_LIB to link with -lcharset
On some systems, the function locale_charset() may not be exported from
libiconv but is available from libcharset, and we need -lcharset when
linking.

Introduce a make variable CHARSET_LIB that can be set to -lcharsetlib
on such systems.  Also autodetect this in the configure script by first
looking for the symbol in libiconv, and then libcharset.

Signed-off-by: Дилян Палаузов <dilyan.palauzov@aegee.org>
2012-02-13 00:11:01 -08:00
Junio C Hamano 624d3519c9 Update draft release notes to 1.7.10
Again this round mostly consists of fixes for 1.7.9 in preparation for
merging these topics down to maint for 1.7.9.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-12 22:58:36 -08:00
Junio C Hamano aa47ec99d1 Merge branch 'jc/checkout-out-of-unborn'
* jc/checkout-out-of-unborn:
  git checkout -b: allow switching out of an unborn branch
2012-02-12 22:43:45 -08:00
Junio C Hamano b95ffc143f Merge branch 'jc/maint-mailmap-output'
* jc/maint-mailmap-output:
  mailmap: always return a plain mail address from map_user()
2012-02-12 22:43:39 -08:00
Junio C Hamano 974e978b09 Merge branch 'jk/prompt-fallback-to-tty'
* jk/prompt-fallback-to-tty:
  prompt: fall back to terminal if askpass fails
  prompt: clean up strbuf usage
2012-02-12 22:43:34 -08:00
Junio C Hamano d1168b9033 Merge branch 'jn/gitweb-search-utf-8'
* jn/gitweb-search-utf-8:
  gitweb: Allow UTF-8 encoded CGI query parameters and path_info

Conflicts:
	gitweb/gitweb.perl
2012-02-12 22:43:24 -08:00
Junio C Hamano 2ef80c2d89 Merge branch 'nd/diffstat-gramnum'
* nd/diffstat-gramnum:
  Use correct grammar in diffstat summary line
2012-02-12 22:43:19 -08:00
Junio C Hamano dd5253b4bd Merge branch 'nd/find-pack-entry-recent-cache-invalidation'
* nd/find-pack-entry-recent-cache-invalidation:
  find_pack_entry(): do not keep packed_git pointer locally
  sha1_file.c: move the core logic of find_pack_entry() into fill_pack_entry()
2012-02-12 22:43:03 -08:00
Junio C Hamano 6ff63d9f87 Merge branch 'tt/profile-build-fix'
* tt/profile-build-fix:
  Makefile: fix syntax for older make
  Fix build problems related to profile-directed optimization
2012-02-12 22:42:46 -08:00
Junio C Hamano a7844827da Merge branch 'nd/cache-tree-api-refactor'
* nd/cache-tree-api-refactor:
  cache-tree: update API to take abitrary flags
2012-02-12 22:42:42 -08:00
Junio C Hamano 75f49651a1 Merge branch 'fc/zsh-completion'
* fc/zsh-completion:
  completion: simplify __gitcomp and __gitcomp_nl implementations
  completion: use ls -1 instead of rolling a loop to do that ourselves
  completion: work around zsh option propagation bug
2012-02-12 22:42:35 -08:00
Junio C Hamano 297638a98e Merge branch 'mp/make-cleanse-x-for-exe'
* mp/make-cleanse-x-for-exe:
  Explicitly set X to avoid potential build breakage
2012-02-12 22:42:17 -08:00
Junio C Hamano 8ed9f5d6a7 Merge branch 'bw/inet-pton-ntop-compat'
* bw/inet-pton-ntop-compat:
  Drop system includes from inet_pton/inet_ntop compatibility wrappers
2012-02-12 22:42:14 -08:00
Junio C Hamano 44a1020d4d Merge branch 'jc/maint-commit-ignore-i-t-a'
* jc/maint-commit-ignore-i-t-a:
  commit: ignore intent-to-add entries instead of refusing

Conflicts:
	cache-tree.c
2012-02-12 22:42:10 -08:00
Junio C Hamano 1efb73322a Merge branch 'jk/maint-tag-show-fixes'
* jk/maint-tag-show-fixes:
  tag: do not show non-tag contents with "-n"
  tag: die when listing missing or corrupt objects
  tag: fix output of "tag -n" when errors occur

Conflicts:
	t/t7004-tag.sh
2012-02-12 22:42:06 -08:00
Junio C Hamano 8c18a6f3fa Merge branch 'mm/empty-loose-error-message'
* mm/empty-loose-error-message:
  fsck: give accurate error message on empty loose object files
2012-02-12 22:42:02 -08:00
Junio C Hamano 39ee1710c0 Merge branch 'nk/ctype-for-perf'
* nk/ctype-for-perf:
  ctype: implement islower/isupper macro
  ctype.c only wants git-compat-util.h
2012-02-12 22:41:56 -08:00
Junio C Hamano 5cdc9fbb08 Merge branch 'jn/merge-no-edit-fix'
* jn/merge-no-edit-fix:
  merge: do not launch an editor on "--no-edit $tag"

Conflicts:
	builtin/merge.c
2012-02-12 22:41:51 -08:00
Jakub Narebski f4212089c2 gitweb: Harden and improve $project_filter page title
Commit 19d2d23 (gitweb: add project_filter to limit project list
to a subdirectory, 2012-01-30) added also support for displaying
$project_filter, if present, in page title.

Unfortunately it forgot to treat $project_filter as path, and escape
it using esc_path(), like it is done for $filename.

Also, it was not obvious that "$site_name - $project_filter" is about
project filtering: use "$site_name - projects in '$project_filter'".

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-12 22:11:31 -08:00
Michael Haggerty cf6672edb1 refs: remove the extra_refs API
The extra_refs provided a kludgy way to create fake references at a
global level in the hope that they would only affect some particular
code path.  The last user of this API been rewritten, so strip this
stuff out before somebody else gets the bad idea of using it.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-12 19:50:39 -08:00
Michael Haggerty a1287f7540 clone: do not add alternate references to extra_refs
Alternate references are directly (and now, correctly) handled by
fetch-pack, so there is no need to inform fetch-pack about them via
the extra_refs back channel.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-12 19:50:39 -08:00
Michael Haggerty f257659132 everything_local(): mark alternate refs as complete
Objects in an alternate object database are already available to the
local repository and therefore don't need to be fetched.  So mark them
as complete in everything_local().

This fixes a test in t5700.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-12 19:50:39 -08:00
Michael Haggerty c41a802fe9 fetch-pack.c: inline insert_alternate_refs()
The logic of the (single) caller is clearer without encapsulating this
one line in a function.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-12 19:50:39 -08:00
Michael Haggerty 65385ef7d4 fetch-pack.c: rename some parameters from "path" to "refname"
The parameters denote reference names, which are no longer 1:1 with
filesystem paths.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-12 19:50:39 -08:00
Michael Haggerty 5b05795c4c clone.c: move more code into the "if (refs)" conditional
The bahavior of a bunch of code before the "if (refs)" statement also
depends on whether refs is set, so make the logic clearer by shifting
this code into the if statement.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-12 19:50:39 -08:00
Michael Haggerty acede2ebc9 t5700: document a failure of alternates to affect fetch
If an alternate supplies some, but not all, of the objects needed for
a fetch, fetch-pack nevertheless generates "want" lines for the
alternate objects that are present.  Demonstrate this problem via a
failing test.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-12 19:50:39 -08:00
Linus Torvalds 8580830084 "git pull" doesn't know "--edit"
Ok, so now "git merge" defaults to editing when interactive - lovely. But
when testing that, I noticed that while you can say

   git merge --[no-]edit ..branch..

that does not work with "git pull". You get a message like

  error: unknown option `no-edit'
  usage: git fetch [<options>] [<repository> [<refspec>...]]
     or: git fetch [<options>] <group>
     or: git fetch --multiple [<options>] [(<repository> | <group>)...]
     or: git fetch --all [<options>]

      -v, --verbose         be more verbose
      -q, --quiet           be more quiet
      --all                 fetch from all remotes
  ...

which is because that stupid shell script doesn't know about the new
flags, and just passes it to "git fetch" instead.

Now, I really wanted to just make "git pull" a built-in instead of that
nasty shell script, but I'm lazy. So here's the trivial updates to
git-pull.sh to at least teach it about -e/--edit/--no-edit.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-12 19:24:47 -08:00