1
0
mirror of https://github.com/git/git.git synced 2024-10-20 09:59:05 +02:00
Commit Graph

25341 Commits

Author SHA1 Message Date
Ævar Arnfjörð Bjarmason
d3e1ddfd39 i18n: mark clone nonexistent repository message for translation
Mark the "repository '%s' does not exist" message added in
v1.7.4.2~21^2 (clone: die when trying to clone missing local path) by
Jeff King for translation.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-12 00:12:53 -07:00
Ævar Arnfjörð Bjarmason
f68f180172 i18n: mark merge CHERRY_PICK_HEAD messages for translation
Mark CHERRY_PICK_HEAD related messages in builtin/merge.c that were
added in v1.7.5-rc0~88^2~2 (Introduce CHERRY_PICK_HEAD) by Jay Soffian
for translation.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-12 00:12:53 -07:00
Ævar Arnfjörð Bjarmason
c7f426d4bc i18n: mark merge "upstream" messages for translation
Mark the merge messages that were added in v1.7.5-rc1~17^2 (merge:
merge with the default upstream branch without argument) by Junio C
Hamano for translation.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-12 00:12:53 -07:00
Ævar Arnfjörð Bjarmason
650ed9db74 i18n: mark merge "Could not read from" message for translation
Mark the "Could not read from '%s'" message that was added to
builtin/merge.c in v1.7.4.2~25^2 (merge: honor prepare-commit-msg
hook) by Jay Soffian for translation.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-12 00:12:53 -07:00
Junio C Hamano
9db1941458 Merge branch 'js/checkout-untracked-symlink'
* js/checkout-untracked-symlink:
  t2021: mark a test as fixed
2011-04-12 00:05:50 -07:00
Junio C Hamano
5dee1532e1 Merge branch 'nd/init-gitdir'
* nd/init-gitdir:
  t0001: guard a new test with SYMLINKS prerequisite
2011-04-12 00:04:53 -07:00
Johannes Sixt
9973d9329b t2021: mark a test as fixed
The failure was fixed by the previous commit.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-12 00:03:54 -07:00
Johannes Sixt
4e95fb6c37 t0001: guard a new test with SYMLINKS prerequisite
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-11 23:57:56 -07:00
Erik Faye-Lund
e96c19c50f config: support values longer than 1023 bytes
parse_value in config.c has a static buffer of 1024 bytes that it
parse the value into. This can sometimes be a problem when a
config file contains very long values.

It's particularly amusing that git-config already is able to write
such files, so it should probably be able to read them as well.

Fix this by using a strbuf instead of a fixed-size buffer.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-11 14:10:06 -07:00
Erik Faye-Lund
5e7a5d97f8 strbuf: make sure buffer is zero-terminated
strbuf_init does not zero-terminate the initial buffer when hint is
non-zero. Fix this so we can rely on the string to be zero-terminated
even if we haven't filled it with anything yet.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-11 14:10:05 -07:00
Johan Herland
2ff3a80334 Teach --dirstat not to completely ignore rearranged lines within a file
Currently, the --dirstat analysis ignores when lines within a file are
rearranged, because the "damage" calculated by show_dirstat() is 0.
However, if the object name has changed, we already know that there is
some damage, and it is unintuitive to claim there is _no_ damage.

Teach show_dirstat() to assign a minimum amount of damage (== 1) to
entries for which the analysis otherwise yields zero damage, to still
represent that these files are changed, instead of saying that there
is no change.

Also, skip --dirstat analysis when the object names are the same (e.g. for
a pure file rename).

Signed-off-by: Johan Herland <johan@herland.net>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-11 11:16:15 -07:00
Ramsay Jones
1e0f8c41ac sparse: Fix an "symbol 'merge_file' not decared" warning
In order to fix the warning, we add a new "merge-file.h" header
containing the extern declaration of the merge_file() function,
and include the header in the source files that require the
declaration.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-11 10:35:25 -07:00
Ramsay Jones
c8f1444d9e sparse: Fix an "symbol 'format_subject' not declared" warning
In order to fix the warning, we add an extern declaration for this
function to the "commit.h" header file, along with all other non-
static functions defined in pretty.c. Also, we remove the function
declaration from builtin/shortlog.c, since it is no longer needed.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-11 10:35:25 -07:00
Ramsay Jones
d27da38a19 sparse: Fix some "Using plain integer as NULL pointer" warnings
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-11 10:35:25 -07:00
Ramsay Jones
2ad9d4cb18 sparse: Fix an "symbol 'cmd_index_pack' not declared" warning
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-11 10:35:25 -07:00
Ramsay Jones
f228d1f006 Makefile: Use cgcc rather than sparse in the check target
cgcc is the recommended way to run sparse, since it provides
many -Defines suitable for the given gcc platform. Using an
"cgcc -no-compile" command runs sparse, with all the platform
specific definitions provided by cgcc, without also invoking
gcc.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-11 10:35:25 -07:00
Ævar Arnfjörð Bjarmason
ff46a49afa Makefile: extract Q_() source strings as ngettext()
The Q_() wrapper added by 0c9ea33 (i18n: add stub Q_() wrapper for
ngettext, 2011-03-09) needs to be noticed by xgettext.

Add an appropriate --keyword option to the Makefile, so that "make pot"
would notice the strings in the plural form marked with the wrapper.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-11 10:34:50 -07:00
Ramsay Jones
642f85faab i18n: avoid parenthesized string as array initializer
The syntax

    static const char ignore_error[] = ("something");

is invalid C.  A parenthesized string is not allowed as an array
initializer.

Some compilers, for example GCC and MSVC, allow this syntax as an
extension, but it is not a portable construct.  tcc does not parse it, for
example.

Remove the parenthesis from the definition of the N_() macro to
fix this.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-11 10:33:51 -07:00
Johan Herland
0133dab75d --dirstat-by-file: Make it faster and more correct
Currently, when using --dirstat-by-file, it first does the full --dirstat
analysis (using diffcore_count_changes()), and then resets 'damage' to 1,
if any damage was found by diffcore_count_changes().

But --dirstat-by-file is not interested in the file damage per se. It only
cares if the file changed at all. In that sense it only cares if the blob
object for a file has changed. We therefore only need to compare the
object names of each file pair in the diff queue and we can skip the
entire --dirstat analysis and simply set 'damage' to 1 for each entry
where the object name has changed.

This makes --dirstat-by-file faster, and also bypasses --dirstat's practice
of ignoring rearranged lines within a file.

The patch also contains an added testcase verifying that --dirstat-by-file
now detects changes that only rearrange lines within a file.

Signed-off-by: Johan Herland <johan@herland.net>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-11 10:12:24 -07:00
Johan Herland
204f01a2f7 --dirstat: Describe non-obvious differences relative to --stat or regular diff
Also add a testcase documenting the current behavior.

Improved-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-11 10:11:17 -07:00
Junio C Hamano
e3fa246551 Merge git://git.bogomips.org/git-svn
* git://git.bogomips.org/git-svn:
  git-svn: Cache results of running the executable "git config"
  git-svn: Add a svn-remote.<name>.pushurl config key
2011-04-11 09:34:19 -07:00
Junio C Hamano
2dbae5acc7 Merge git://git.kernel.org/pub/scm/gitk/gitk
* git://git.kernel.org/pub/scm/gitk/gitk:
  gitk: Update cherry-pick error message parsing
  gitk: Quote tag names in event bindings to avoid problems with % chars
  gitk: Allow user to control how much of the SHA1 ID gets auto-selected
  gitk: spelling fixes in Russian translation
  gitk: Take only numeric version components when computing $git_version
2011-04-11 09:33:06 -07:00
James Y Knight
f5549afd5d git-svn: Cache results of running the executable "git config"
Running programs is not cheap!

Signed-off-by: James Y Knight <jknight@itasoftware.com>
Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
2011-04-09 22:43:35 +00:00
Alejandro R. Sedeño
12a296bca3 git-svn: Add a svn-remote.<name>.pushurl config key
Similar to the 'remote.<name>.pushurl' config key for git remotes,
'pushurl' is designed to be used in cases where 'url' points to an SVN
repository via a read-only transport, to provide an alternate
read/write transport. It is assumed that both keys point to the same
repository.

The 'pushurl' key is distinct from the 'commiturl' key in that
'commiturl' is a full svn path while 'pushurl' (like 'url') is a base
path. 'commiturl' takes precendece over 'pushurl' in cases where
either might be used.

The 'pushurl' is used by git-svn's dcommit and branch commands.

Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu>
Reviewed-by: James Y Knight <jknight@itasoftware.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2011-04-09 22:43:35 +00:00
Anders Kaseorg
b74307f6a5 gitk: Update cherry-pick error message parsing
Commit 981ff5c37ae20687c98d98c8689d5e89016026d2 changed the error
message from git cherry-pick from
    Automatic cherry-pick failed.  [...advice...]
to
    error: could not apply 7ab78c9... Do something neat.
    [...advice...]

Update gitk’s regex to match this, restoring the ability to launch git
citool to resolve conflicted cherry-picks.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2011-04-09 22:19:38 +10:00
Junio C Hamano
4e8115fff1 merge: allow "-" as a short-hand for "previous branch"
Just like "git checkout -" is a short-hand for "git checkout @{-1}" to
conveniently switch back to the previous branch, "git merge -" is a
short-hand for "git merge @{-1}" to conveniently merge the previous branch.

It will allow me to say:

    $ git checkout -b au/topic
    $ git am -s ./+au-topic.mbox
    $ git checkout pu
    $ git merge -

which is an extremely typical and repetitive operation during my git day.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-07 15:57:57 -07:00
Dan McGee
3a243f7024 stash: ensure --no-keep-index and --patch can be used in any order
Don't assume one comes after the other on the command line. Use a
three-state variable to track and check its value accordingly.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-07 15:54:04 -07:00
Dan McGee
21ec98a75d stash: add two more tests for --no-keep-index
One of these passes just fine; the other one exposes a problem where
command line flag order matters for --no-keep-index and --patch
interaction.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-07 15:53:02 -07:00
Andrew Garber
c3f6163b0b git-p4: replace each tab with 8 spaces for consistency
Note that the majority of git-p4 uses spaces, not tabs, for indentation.
Consistent indentation is a good hygiene for Python scripts, and mixing
tabs and spaces in Python can lead to hard-to-find bugs.

Signed-off-by: Andrew Garber <andrew@andrewgarber.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-07 00:37:45 -07:00
Ramkumar Ramachandra
48672b3dc7 Documentation: Allow custom diff tools to be specified in 'diff.tool'
Apart from the list of "valid values", 'diff.tool' can take any value,
provided there is a corresponding 'difftool.<tool>.cmd' option.  Also,
describe this option just before the 'difftool.*' options.

Helped-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-06 15:24:10 -07:00
Ramkumar Ramachandra
90b94c26f7 Documentation: Add diff.<driver>.* to config
Although the gitattributes page contains comprehensive information
about these configuration options, they should be included in the
config documentation for completeness.

It may be better to rename the "driver" in "diff.<driver>.*" to
something like "content type" or "file type", but for now, let's keep
it consistent across this part of the documentation and the original
description in the gitattributes documentation.

Helped-by: Jakub Narebski <jnareb@gmail.com>
Helped-by: Michael J Gruber <git@drmicha.warpmail.net>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-06 15:22:17 -07:00
Ramkumar Ramachandra
19299a84f7 Documentation: Move diff.<driver>.* from config.txt to diff-config.txt
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-06 15:19:53 -07:00
Ramkumar Ramachandra
26488f5922 Documentation: Add filter.<driver>.* to config
Although the gitattributes page contains comprehensive information
about these configuration options, they should be included in the
config documentation for completeness.

Helped-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-06 15:17:06 -07:00
Jeff King
b961219779 upload-pack: start pack-objects before async rev-list
In a pthread-enabled version of upload-pack, there's a race condition
that can cause a deadlock on the fflush(NULL) we call from run-command.

What happens is this:

  1. Upload-pack is informed we are doing a shallow clone.

  2. We call start_async() to spawn a thread that will generate rev-list
     results to feed to pack-objects. It gets a file descriptor to a
     pipe which will eventually hook to pack-objects.

  3. The rev-list thread uses fdopen to create a new output stream
     around the fd we gave it, called pack_pipe.

  4. The thread writes results to pack_pipe. Outside of our control,
     libc is doing locking on the stream. We keep writing until the OS
     pipe buffer is full, and then we block in write(), still holding
     the lock.

  5. The main thread now uses start_command to spawn pack-objects.
     Before forking, it calls fflush(NULL) to flush every stdio output
     buffer. It blocks trying to get the lock on pack_pipe.

And we have a deadlock. The thread will block until somebody starts
reading from the pipe. But nobody will read from the pipe until we
finish flushing to the pipe.

To fix this, we swap the start order: we start the
pack-objects reader first, and then the rev-list writer
after. Thus the problematic fflush(NULL) happens before we
even open the new file descriptor (and even if it didn't,
flushing should no longer block, as the reader at the end of
the pipe is now active).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-06 14:38:47 -07:00
Junio C Hamano
6be0559183 Git 1.7.5-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.7.5-rc1
2011-04-06 10:57:32 -07:00
Junio C Hamano
e38f2a88e5 Sync with 1.7.4.4 2011-04-06 10:51:30 -07:00
Junio C Hamano
5fb41b883a Git 1.7.4.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.7.4.4
2011-04-06 10:50:00 -07:00
Junio C Hamano
0c41f33c19 Merge branch 'nm/maint-conflicted-submodule-entries' into maint
* nm/maint-conflicted-submodule-entries:
  submodule: process conflicting submodules only once
2011-04-06 10:41:17 -07:00
Junio C Hamano
df0a6aeb35 Merge branch 'mg/rev-list-n-reverse-doc' into maint
* mg/rev-list-n-reverse-doc:
  git-log.txt,rev-list-options.txt: put option blocks in proper order
  git-log.txt,rev-list-options.txt: -n/--max-count is commit limiting
2011-04-06 10:40:49 -07:00
Junio C Hamano
cea667e955 Merge branch 'jk/maint-remote-mirror-safer'
* jk/maint-remote-mirror-safer:
  remote: deprecate --mirror
  remote: separate the concept of push and fetch mirrors
  remote: disallow some nonsensical option combinations
2011-04-06 10:38:14 -07:00
Junio C Hamano
7e3ead13e5 Merge branch 'mg/doc-revisions-txt'
* mg/doc-revisions-txt:
  revisions.txt: language improvements
  revisions.txt: structure with a labelled list
  revisions.txt: consistent use of quotes
2011-04-06 10:37:56 -07:00
Jeff King
e0e2a9cbfa stash: drop dirty worktree check on apply
Before we apply a stash, we make sure there are no changes
in the worktree that are not in the index. This check dates
back to the original git-stash.sh, and is presumably
intended to prevent changes in the working tree from being
accidentally lost during the merge.

However, this check has two problems:

  1. It is overly restrictive. If my stash changes only file
     "foo", but "bar" is dirty in the working tree, it will
     prevent us from applying the stash.

  2. It is redundant. We don't touch the working tree at all
     until we actually call merge-recursive. But it has its
     own (much more accurate) checks to avoid losing working
     tree data, and will abort the merge with a nicer
     message telling us which paths were problems.

So we can simply drop the check entirely.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-06 09:41:22 -07:00
Junio C Hamano
15366280c2 Teach core.bigfilethreashold to pack-objects
The pack-objects command should take notice of the object file and
refrain from attempting to delta large ones, to be consistent with
the fast-import command.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-05 20:25:49 -07:00
Namhyung Kim
84393bfd73 blame: add --abbrev command line option and make it honor core.abbrev
If user sets config.abbrev option, use it as if --abbrev was given.  This
is the default value and user can override different abbrev length by
specifying the --abbrev=N command line option.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-05 20:08:41 -07:00
Jon Seymour
9355fc9c35 stash: fix false positive in the invalid ref test.
Jeff King reported a problem with git stash apply incorrectly
applying an invalid stash reference.

There is an existing test that should have caught this, but
the test itself was broken, resulting in a false positive.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-05 20:01:52 -07:00
Jeff King
59d418fe10 stash: fix accidental apply of non-existent stashes
Once upon a time, "git rev-parse ref@{9999999}" did not
generate an error. Therefore when we got an invalid stash
reference in "stash apply", we could end up not noticing
until quite late.  Commit b0f0ecd (detached-stash: work
around git rev-parse failure to detect bad log refs,
2010-08-21) handled this by checking for the "Log for stash
has only %d entries" warning on stderr when we validated the
ref.

A few days later, e6eedc3 (rev-parse: exit with non-zero
status if ref@{n} is not valid., 2010-08-24) fixed the
original issue. That made the extra stderr test superfluous,
but also introduced a new bug. Now the early call to:

  git rev-parse --symbolic "$@"

fails, but we don't notice the exit code. Worse, its empty
output means we think the user didn't provide us a ref, and
we try to apply stash@{0}.

This patch checks the rev-parse exit code and fails early in
the revision parsing process. We can also get rid of the
stderr test; as a bonus, this means that "stash apply" can
now run under GIT_TRACE=1 properly.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-05 20:01:37 -07:00
Junio C Hamano
33e0f62ba9 pathspec: rename per-item field has_wildcard to use_wildcard
As the point of the last change is to allow use of strings as
literals no matter what characters are in them, "has_wildcard"
does not match what we use this field for anymore.

It is used to decide if the wildcard matching should be used, so
rename it to match the usage better.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-05 09:30:36 -07:00
Dan McGee
7cd52b5b4b Share color list between graph and show-branch
This also adds the new colors to show-branch that were added a while
back for graph output.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-04 23:20:39 -07:00
Michael J Gruber
b62c769730 revisions.txt: language improvements
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-04 16:43:57 -07:00
Junio C Hamano
fa38cfc2c6 Merge branch 'maint'
* maint:
  Documentation: trivial grammar fix in core.worktree description
  gitweb: Fix parsing of negative fractional timezones in JavaScript
2011-04-04 15:02:08 -07:00