1
0
mirror of https://github.com/git/git.git synced 2024-10-22 15:58:13 +02:00
Commit Graph

34293 Commits

Author SHA1 Message Date
Eric Sunshine
5a9830cb71 t8001/t8002 (blame): add blame -L :funcname tests
git-blame inherited "-L :funcname" support when "-L :funcname:file" was
implemented for git-log. Add tests.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-17 18:02:22 -07:00
Eric Sunshine
03e15fc0b6 t8001/t8002 (blame): add blame -L tests
With the exception of a couple "corner case" checks in t8003 (and some
indirect tests in t4211 of -L parsing code shared by log -L), there is
no systematic checking of blame -L.  Add tests to check blame -L
directly.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-17 18:02:22 -07:00
Eric Sunshine
e37f39c134 t8001/t8002 (blame): modernize style
In particular,

- indent with tabs
- cuddle test description and opening body quote with test_expect_foo
- normalize test descriptions and case
- remove whitepsace following redirection operator
- use standardized filenames (such as "actual", "expected")

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-17 18:02:21 -07:00
Eric Sunshine
3bf65f9e62 line-range: fix "blame -L X,-N" regression
"blame -L X,-N" is documented as blaming "N lines ending at X".  In
practice, the behavior is achieved by swapping the two range endpoints
if the second is less than the first.  25ed3412 (Refactor parse_loc;
2013-03-28) broke this interpretation by removing the swapping code from
blame.c and failing to add it to line-range.c along with other code
relocated from blame.c. Thus, such a range is effectively treated as
empty.  Fix this regression.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-17 18:02:12 -07:00
René Scharfe
76053e77ef .mailmap: René Scharfe has a new email address
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-17 17:55:05 -07:00
Doug Bell
3f3d0cea61 show-ref: make --head always show the HEAD ref
The docs seem to say that doing

	git show-ref --head --tags

would show both the HEAD ref and all the tag refs. However, doing
both --head and either of --tags or --heads would filter out the HEAD
ref.

Also update the documentation to describe the new behavior and add
tests for the show-ref command.

[jc: Doug did proofread the tests, but it was done by me and bugs in
it are mine].

Signed-off-by: Doug Bell <madcityzen@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-17 17:52:28 -07:00
Matthieu Moy
4ba258b7e1 Documentation/git-log.txt: capitalize section names
This is the convention in most other files and even at the beginning of
git-log.txt

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-17 17:50:56 -07:00
Matthieu Moy
7b02c83463 Documentation: move description of -s, --no-patch to diff-options.txt
Technically, "-s, --no-patch" is implemented in diff.c ("git diff
--no-patch" is essentially useless, but valid). From the user point of
view, this allows the documentation to show up in "git show --help",
which is one of the most useful use of the option.

While we're there, add a sentence explaining why the option can be
useful.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-17 17:50:56 -07:00
Matthieu Moy
0791ab02c2 Documentation/git-show.txt: include common diff options, like git-log.txt
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-17 17:50:56 -07:00
Matthieu Moy
71482d389d diff: allow --patch & cie to override -s/--no-patch
All options that trigger a patch output now override --no-patch.

The case of --binary deserves extra attention: the name may suggest that
it turns a normal patch into a binary patch, but it actually already
enables patch output when normally disabled (e.g. "git log --binary"
displays a patch), hence it makes sense for "git show --no-patch
--binary" to display the binary patch.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-17 17:50:56 -07:00
Matthieu Moy
d09cd15d19 diff: allow --no-patch as synonym for -s
This follows the usual convention of having a --no-foo option to negate
--foo.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-17 17:50:56 -07:00
Matthieu Moy
8ade9b140f t4000-diff-format.sh: modernize style
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-17 17:50:56 -07:00
Eric Sunshine
001b0976af git-log.txt: fix typesetting of example "git-log -L" invocation
All surrounding examples are typeset as monospaced text. Follow suit.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Acked-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-17 12:58:36 -07:00
Thomas Rast
a11c39646c git: ensure 0/1/2 are open in main()
Not having an open FD in the 0--2 range can lead to strange results,
for example, a subsequent open() may return 2 (stderr) and then a
die() would clobber this file.

git-daemon and git-shell already guarded against this, but apparently
users also manage to trip over it in other git commands.  So we call
sanitize_stdfds() during main git startup.

Since these FDs are inherited, this covers all use of 'git foo ...',
and all internal C commands when called directly.  It does not fix
shell/perl commands called directly.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-17 12:52:16 -07:00
Thomas Rast
1d999ddd1d daemon/shell: refactor redirection of 0/1/2 from /dev/null
Both daemon.c and shell.c contain logic to open FDs 0/1/2 from
/dev/null if they are not already open.  Move the function in daemon.c
to setup.c and use it in shell.c, too.

While there, remove a 'not' that inverted the meaning of the comment.
The point is indeed to *avoid* messing up.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-17 12:50:34 -07:00
Dirk Wallenstein
ace33bf991 request-pull: improve error message for invalid revision args
Currently, when an invalid revision is specified, the error message is:

    fatal: Needed a single revision

This is misleading because, you might think there is something wrong
with the command line as a whole.

Now the user gets a more meaningful error message, showing the invalid
revision.

Signed-off-by: Dirk Wallenstein <halsmit@t-online.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-17 12:30:58 -07:00
Michael Haggerty
bc501f69fc git-multimail: an improved replacement for post-receive-email
Add git-multimail, a tool for generating notification emails for
pushes to a Git repository.  It is largely plug-in compatible with
post-receive-email, and is proposed to eventually replace that script.
The advantages of git-multimail relative to post-receive-email are
described in README.migrate-from-post-receive-email.

git-multimail is organized in a directory contrib/hooks/multimail.
The directory contains:

* git_multimail.py -- a Python module that can generate notification
  emails for pushes to a Git repository.  The file can be used
  directly as a post-receive script (configured via git config
  settings), or it can be imported as a Python module and configured
  via arbitrary Python code.

* README -- user-level documentation for configuring and using
  git-multimail.

* post-receive -- an example of building a post-receive script that
  imports git_multimail.py as a Python module, with an example of how
  to change the email templates.

* README.migrate-from-post-receive-email -- documentation targeted at
  current users of post-receive-email, explaining the differences and
  how to migrate a post-receive-email configuration to git-multimail.

* migrate-mailhook-config -- a script that can migrate a user's
  post-receive-email configuration options to the equivalent
  git-multimail options.

* README.Git -- a short explanation of the relationship between
  git-multimail and the rest of the Git project, plus the exact date
  and revision when this version was taken from the upstream project.

All but the last file are taken verbatim from the upstream
git-multimail project.

git-multimail is originally derived from post-receive-email and also
incorporates suggestions from the mailing list as well as patches by
the people listed below.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Contributions-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Contributions-by: Ramkumar Ramachandra <artagnon@gmail.com>
Contributions-by: Chris Hiestand <chrishiestand@gmail.com>
Contributions-by: Michiel Holtkamp <git@elfstone.nl>
Contributions-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15 12:59:48 -07:00
Matthijs Kooijman
4b796951ff upload-pack: remove a piece of dead code
Commit 682c7d2 (upload-pack: fix off-by-one depth calculation in shallow
clone) introduced a new check in get_shallow_commits to decide when to
stop traversing the history and mark the current commit as a shallow
root.

With this new check in place, the old check can no longer be true, since
the first check always fires first. This commit removes that check,
making the code a bit more simple again.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Duy Nguyen <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15 10:49:42 -07:00
Junio C Hamano
9c3c367b26 Update draft release notes to 1.8.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15 10:45:33 -07:00
Junio C Hamano
dbc96a77a4 Sync with 1.8.3.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15 10:45:02 -07:00
Junio C Hamano
5addd1c753 Git 1.8.3.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.8.3.3
2013-07-15 10:39:43 -07:00
Junio C Hamano
90360c710c Merge branch 'tr/maint-apply-non-git-patch-parsefix' into maint
"git apply" parsed patches that add new files, generated by programs
other than Git, incorrectly.  This is an old breakage in v1.7.11.

* tr/maint-apply-non-git-patch-parsefix:
  apply: carefully strdup a possibly-NULL name
2013-07-15 10:36:14 -07:00
Junio C Hamano
29b2f0565a Merge branch 'bc/http-keep-memory-given-to-curl' into maint
Older cURL wanted piece of memory we call it with to be stable, but
we updated the auth material after handing it to a call.

* bc/http-keep-memory-given-to-curl:
  http.c: don't rewrite the user:passwd string multiple times
2013-07-15 10:36:01 -07:00
Junio C Hamano
d2db8f78c4 Merge branch 'jk/pull-into-dirty-unborn' into maint
"git pull" into nothing trashed "local changes" that were in the
index.

* jk/pull-into-dirty-unborn:
  pull: merge into unborn by fast-forwarding from empty tree
  pull: update unborn branch tip after index
2013-07-15 10:35:43 -07:00
Junio C Hamano
1f101bf650 Merge branch 'fg/submodule-non-ascii-path' into maint
Many "git submodule" operations did not work on a submodule at a
path whose name is not in ASCII.

* fg/submodule-non-ascii-path:
  t7400: test of UTF-8 submodule names pass under Mac OS
  handle multibyte characters in name
2013-07-15 10:35:17 -07:00
Junio C Hamano
1b790212ef Merge branch 'fc/sequencer-plug-leak' into maint
"cherry-pick" had a small leak in its error codepath.

* fc/sequencer-plug-leak:
  sequencer: avoid leaking message buffer when refusing to create an empty commit
  sequencer: remove useless indentation
2013-07-15 10:35:04 -07:00
Junio C Hamano
8ca36db013 Merge branch 'mt/send-email-cc-match-fix' into maint
Logic used by git-send-email to suppress cc mishandled names like "A
U. Thor" <author@example.xz>, where the human readable part needs to
be quoted (the user input may not have the double quotes around the
name, and comparison was done between quoted and unquoted strings).
It also mishandled names that need RFC2047 quoting.

* mt/send-email-cc-match-fix:
  send-email: sanitize author when writing From line
  send-email: add test for duplicate utf8 name
  test-send-email: test for pre-sanitized self name
  t/send-email: test suppress-cc=self with non-ascii
  t/send-email: add test with quoted sender
  send-email: make --suppress-cc=self sanitize input
  t/send-email: test suppress-cc=self on cccmd
  send-email: fix suppress-cc=self on cccmd
  t/send-email.sh: add test for suppress-cc=self
2013-07-15 10:34:36 -07:00
Junio C Hamano
f23777cda9 Merge branch 'bc/send-email-use-port-as-separate-param'
Pass port number as a separate argument when send-email initializes
Net::SMTP, instead of as a part of the hostname, i.e. host:port.
This allows GSSAPI codepath to match with the hostname given.

* bc/send-email-use-port-as-separate-param:
  send-email: provide port separately from hostname
2013-07-15 10:28:50 -07:00
Junio C Hamano
2bb7aface6 Merge branch 'fg/submodule-clone-depth'
Allow shallow-cloning of submodules with "git submodule update".

* fg/submodule-clone-depth:
  Add --depth to submodule update/add
2013-07-15 10:28:48 -07:00
Junio C Hamano
3bb6149186 Merge branch 'cp/submodule-custom-update'
In addition to the choice from "rebase, merge, or checkout-detach",
allow a custom command to be used in "submodule update" to update
the working tree of submodules.

* cp/submodule-custom-update:
  submodule update: allow custom command to update submodule working tree
2013-07-15 10:28:44 -07:00
Junio C Hamano
22fcbc420e Merge branch 'jk/format-patch-from'
"git format-patch" learned "--from[=whom]" option, which sets the
"From: " header to the specified person (or the person who runs the
command, if "=whom" part is missing) and move the original author
information to an in-body From: header as necessary.

* jk/format-patch-from:
  teach format-patch to place other authors into in-body "From"
  pretty.c: drop const-ness from pretty_print_context
2013-07-15 10:28:40 -07:00
Junio C Hamano
9678ee7ba3 Merge branch 'mv/merge-ff-tristate'
The configuration variable "merge.ff" was cleary a tri-state to
choose one from "favor fast-forward when possible", "always create
a merge even when the history could fast-forward" and "do not
create any merge, only update when the history fast-forwards", but
the command line parser did not implement the usual convention of
"last one wins, and command line overrides the configuration"
correctly.

* mv/merge-ff-tristate:
  merge: handle --ff/--no-ff/--ff-only as a tri-state option
2013-07-15 10:28:34 -07:00
Junio C Hamano
dd28abca6a Merge branch 'jk/fetch-pack-many-refs'
Fetching between repositories with many refs employed O(n^2)
algorithm to match up the common objects, which has been corrected.

* jk/fetch-pack-many-refs:
  fetch-pack: avoid quadratic behavior in rev_list_push
  commit.c: make compare_commits_by_commit_date global
  fetch-pack: avoid quadratic list insertion in mark_complete
2013-07-15 10:28:31 -07:00
Richard Hartmann
7b3742fa46 templates: spell ASCII in uppercase in pre-commit hook
The name of the encoding is ASCII, not ascii.

Signed-off-by: Richard Hartmann <richih.mailinglist@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15 09:52:57 -07:00
Richard Hartmann
b1d5a570fc templates: Reformat pre-commit hook's message
Now that we're using heredoc, the message can span the full 80 chars.

Signed-off-by: Richard Hartmann <richih.mailinglist@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15 09:52:52 -07:00
Richard Hartmann
27b6e17a6d templates: Use heredoc in pre-commit hook
This way, it is easier to see how the text we give the end users
would look like, and it will allow us to use (near) full width
of the source file.

Signed-off-by: Richard Hartmann <richih.mailinglist@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15 09:51:16 -07:00
Stefan Beller
d3c9cf32ca diff.c: Do not initialize a variable, which gets reassigned anyway.
Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15 09:45:21 -07:00
Stefan Beller
70a0cc9e5c commit: Fix a memory leak in determine_author_info
The date variable is assigned new memory via xmemdupz and 2 lines later
it is assigned new memory again via xmalloc, but the first assignment
is never freed nor used.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15 09:45:21 -07:00
Stefan Beller
5d9cfa29d2 daemon.c:handle: Remove unneeded check for null pointer.
addr doesn't need to be checked at that line as it it already accessed
7 lines before in the if (addr->sa_family).

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15 09:45:11 -07:00
Junio C Hamano
5333f2afc4 Revert "git-clone.txt: remove the restriction on pushing from a shallow clone"
This reverts commit dacd2bcc414e0b7aac36aaa400da0a743c4741cc.

"It fails reliably without corrupting the receiving repository when
it should fail" may be better than the situation before the receiving
end was hardened recently, but the fact that sometimes the push does
not go through still remains.  It is better to advice the users that
they cannot push from a shallow repository as a limitation before
they decide to use (or not to use) a shallow clone.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15 08:35:32 -07:00
Junio C Hamano
bd23794552 mailmap: style fixes
Wrap overlong lines and format the multi-line comments to match our
coding style.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15 08:23:39 -07:00
Eric Sunshine
fbfba7ade0 mailmap: debug: avoid passing NULL to fprintf() '%s' conversion specification
POSIX does not state the behavior of '%s' conversion when passed a
NULL pointer. Some implementations interpolate literal "(null)";
others may crash.

Callers of debug_mm() often pass NULL as indication of either a
missing name or email address.  Instead, let's always supply a
proper string pointer, and make it a bit more descriptive: "(none)"

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15 08:20:32 -07:00
Eric Sunshine
a8002a5f0e mailmap: debug: eliminate -Wformat field precision type warning
The compiler complains that '*' in fprintf() format "%.*s" should
have type int, but we pass size_t. Fix this.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15 08:20:11 -07:00
Eric Sunshine
0939a242fe mailmap: debug: fix malformed fprintf() format conversion specification
Resolve segmentation fault due to size_t variable being consumed by
'%s'.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15 08:19:56 -07:00
Eric Sunshine
c10be0c6ac mailmap: debug: fix out-of-order fprintf() arguments
Resolve segmentation fault due to arguments passed in wrong order.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15 08:18:04 -07:00
Junio C Hamano
97e751be79 mailmap: do not downcase mailmap entries
The email addresses in the records read from the .mailmap file are
downcased very early, and then used to match against e-mail
addresses in the input.  Because we do use case insensitive version
of string list to manage these entries, there is no need to do this,
and worse yet, downcasing the rewritten/canonical e-mail read from
the .mailmap file loses information.

Stop doing that, and also make the string list used to keep multiple
names for an mailmap entry case insensitive (the code that uses the
list, lookup_prefix(), expects a case insensitive match).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15 08:17:20 -07:00
Eric Sunshine
3aff56ddbe t4203: demonstrate loss of uppercase characters in canonical email
The email addresses read from .mailmap are downcased before being
inserted into the mailmap data structure, which undesirably loses
information.  It is impossible, for instance, to map <first.last@host>
to <First.Last@host>. Demonstrate this problem.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15 08:16:32 -07:00
Junio C Hamano
8c3811510e mailmap: do not lose single-letter names
In parse_name_and_email() function, there is this line:

	*name = (nstart < nend ? nstart : NULL);

When the function is given a buffer "A <A@example.org> <old@x.z>",
nstart scans from the beginning of the buffer, skipping whitespaces
(there isn't any, so nstart points at the buffer), while nend starts
from one byte before the first '<' and skips whitespaces backwards
and stops at the first non-whitespace (i.e. it hits "A" at the
beginning of the buffer).  nstart == nend in this case for a
single-letter name, and an off-by-one error makes it fail to pick up
the name, which makes the entry equivalent to

	<A@example.org> <old@x.z>

without the name.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15 08:16:00 -07:00
Eric Sunshine
109025b4e1 t4203: demonstrate loss of single-character name in mailmap entry
A bug in mailmap.c:parse_name_and_email() causes it to overlook the
single-character name in "A <user@host>" and parse it only as
"<user@host>". Demonstrate this problem.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15 08:09:04 -07:00
Stefan Beller
f4f49e2258 .mailmap: Combine more (email, name) to individual persons
I got more responses from people regarding the .mailmap file.
All added persons gave permission to add them to the .mailmap file.

It's mostly email mappings again. However we also have Nick Stokoe,
who contributed as Nick Woolley. He changed his name, but kept the email.

Signed-off-by: Stefan Beller <stefanbeller@googlemail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-15 07:41:53 -07:00