1
0
mirror of https://github.com/git/git.git synced 2024-10-20 12:18:36 +02:00
Commit Graph

14435 Commits

Author SHA1 Message Date
Junio C Hamano
451244d724 diff-lib.c: rename check_work_tree_entity()
The function is about checking for removed work tree item, so name it
accordingly to avoid future confusion.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-04 17:41:27 -07:00
Junio C Hamano
1392a37721 diff: a submodule not checked out is not modified
948dd34 (diff-index: careful when inspecting work tree items, 2008-03-30)
made the work tree check careful not to be fooled by a new directory that
exists at a place the index expects a blob.  For such a change to be a
typechange from blob to submodule, the new directory has to be a
repository.

However, if the index expects a submodule there, we should not insist the
work tree entity to be a repository --- a simple directory that is not a
full fledged repository (even an empty directory would do) should be
considered an unmodified subproject, because that is how a superproject
with a submodule is checked out sparsely by default.

This makes the function check_work_tree_entity() even more careful not to
report a submodule that is not checked out as removed.  It fixes the
recently added test in t4027.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-04 17:41:27 -07:00
Ping Yin
27bfd950c1 Add t7506 to test submodule related functions for git-status
Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-04 17:41:27 -07:00
Ping Yin
7c08a2a637 t4027: test diff for submodule with empty directory
Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-04 17:41:27 -07:00
Heikki Orsila
c697ad143b Cleanup xread() loops to use read_in_full()
Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-03 22:15:25 -07:00
Junio C Hamano
471793f91e Merge branch 'maint'
* maint:
  checkout: don't rfc2047-encode oneline on detached HEAD
  filter-branch: Documentation fix.
2008-05-03 22:15:09 -07:00
Junio C Hamano
6233a5210e Merge branch 'maint-1.5.4' into maint
* maint-1.5.4:
  filter-branch: Documentation fix.
2008-05-03 18:55:33 -07:00
Jeff King
278863180a checkout: don't rfc2047-encode oneline on detached HEAD
When calling pretty_print_commit, there is an implicit
assumption that passing in a non-NULL "subject" variable
for oneline or email formats means that the output is part
of a subject and therefore "subject" to rfc2047 encoding.
This is not the desired effect when reporting the movement
of detached HEAD.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-03 18:47:18 -07:00
Christian Couder
47458bb9d1 Documentation: hooks: fix missing verb in pre-applypatch description
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-03 13:58:59 -07:00
Jeff King
b8960bbe7b diff: make "too many files" rename warning optional
In many cases, the warning ends up as clutter, because the
diff is being done "behind the scenes" from the user (e.g.,
when generating a commit diffstat), and whether we show
renames or not is not particularly interesting to the user.

However, in the case of a merge (which is what motivated the
warning in the first place), it is a useful hint as to why a
merge with renames might have failed.

This patch makes the warning optional based on the code
calling into diffcore. We default to not showing the
warning, but turn it on for merges.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-03 13:40:43 -07:00
Jeff King
50705915ea bump rename limit defaults
The current rename limit default of 100 was arbitrarily
chosen. Testing[1] has shown that on modern hardware, a
limit of 200 adds about a second of computation time, and a
limit of 500 adds about 5 seconds of computation time.

This patch bumps the default limit to 200 for viewing diffs,
and to 500 for performing a merge. The limit for generating
git-status templates is set independently; we bump it up to
200 here, as well, to match the diff limit.

[1]: See <20080211113516.GB6344@coredump.intra.peff.net>

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-03 13:39:53 -07:00
Jeff King
2a2ac92654 add merge.renamelimit config option
The point of rename limiting is to bound the amount of time
we spend figuring out inexact renames. Currently we use a
single value, diff.renamelimit, for all situations. However,
it is probably the case that a user is willing to spend more
time finding renames during a merge than they are while
looking at git-log.

This patch provides a way of setting those values separately
(though for backwards compatibility, merge still falls back
on the diff renamelimit).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-03 13:39:51 -07:00
Junio C Hamano
ec845695c4 Merge commit 'sg/merge-options^' into jk/renamelimit
* commit 'sg/merge-options^':
  merge, pull: add '--(no-)log' command line option
  fmt-merge-msg: add '--(no-)log' options and 'merge.log' config variable
  add 'merge.stat' config variable
  merge, pull: introduce '--(no-)stat' option
  doc: moved merge.* config variables into separate merge-config.txt
2008-05-03 13:18:20 -07:00
Florian Ragwitz
a1748890db filter-branch: Documentation fix.
It's --msg-filter, not --message-filter.

Signed-off-by: Florian Ragwitz <rafl@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-03 12:05:21 -07:00
Adam Simpkins
9b58bfe8f4 log: print log entry terminator even if the message is empty
This eliminates a special case in the show_log() function, to help
simplify the terminator semantics.  Now show_log() always prints a
newline after the log entry when use_terminator is set, even if the log
message is empty.

This change should only affect the --pretty=tformat output, since that
was the only way to trigger this special case.

Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-03 11:50:41 -07:00
Adam Simpkins
028656552b Remove dead code: show_log() sep argument and diff_options.msg_sep
These variables were made unnecessary by commit
3969cf7db1a13a78f3b7a36d8c1084bbe0a53459.

Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-03 11:48:03 -07:00
Michele Ballabio
5e3502dabb gitk: Disable "Reset %s branch to here" when on a detached head
When we are on a detached head - since gitk does not display where
we are - reset has no sense, so disable the relevant line on the
context menu, and point out to the user that we are on a detached head.

Otherwise, a reset from gitk when on a detached head returns the
error:

can't read "headids()": no such element in array
can't read "headids()": no such element in array
    while executing
"removehead $headids($name) $name"
    (procedure "movehead" line 4)
    invoked from within
"movehead $newhead $mainhead"
    (procedure "readresetstat" line 20)
    invoked from within
"readresetstat file4"
    ("eval" body line 1)
    invoked from within
"eval $script"
    (procedure "dorunq" line 9)
    invoked from within
"dorunq"
    ("after" script)

[paulus@samba.org: changed menu item to "Detached head: can't reset"]

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-05-03 17:57:35 +10:00
Christian Stimming
81811a74ba gitk: German translation again updated
This includes suggestions by Stephan Beyer.

Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-05-03 17:54:31 +10:00
Christian Stimming
703232da53 gitk: Update German translation
Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-05-03 17:54:26 +10:00
Gerrit Pape
dfa65bc28e gitk: Makefile/install: force permissions when installing files and dirs
The msg-files msgs/*.msg used to be installed with mode 755 although
they're not executables.  With this commit, files are forced to be
installed with mode 644, directories and executables with mode 755.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-05-02 22:54:02 +10:00
Peter Karlsson
b3449aeafd gitk: Initial Swedish translation.
Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-05-02 22:35:49 +10:00
Santiago Gala
cc398a286b gitk: Spanish translation of gitk
I copied the Italian translation and translated the strings
to Spanish starting from there.  This incorporates suggestions
from Wincent Colaiuta and Carlos Rica.

Signed-off-by: Santiago Gala <sgala@apache.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-05-02 22:32:48 +10:00
Christian Stimming
259cd0fddb git-gui: Update German translation
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-05-01 18:13:14 -04:00
Stephen R. van den Berg
abfa533dea git-svn: Same default as cvsimport when using --use-log-author
When using git-cvsimport, the author is inferred from the cvs commit,
e.g. cvs commit logname is foobaruser, then the author field in git
results in:

Author: foobaruser <foobaruser>

Which is not perfect, but perfectly acceptable given the circumstances.

The default git-svn import however, results in:

Author: foobaruser <foobaruser@acf43c95-373e-0410-b603-e72c3f656dc1>

When using mixes of imports, from CVS and SVN into the same git
repository, you'd like to harmonise the imports to the format cvsimport
uses.
git-svn supports an experimental option --use-log-author which currently
results in the same logentry as without that option when no From: or
Signed-off-by: is found in the logentry ($email currently ends up empty,
and hence is generated again).

This patches harmonises the result with cvsimport, and makes
git-svn --use-log-author produce:

Author: foobaruser <foobaruser>

Signed-off-by: Stephen R. van den Berg <srb@cuci.nl>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-30 23:02:41 -07:00
Junio C Hamano
e4b9c36ca4 Merge branch 'maint'
* maint:
  fetch-pack: brown paper bag fix
2008-04-30 11:43:37 -07:00
Junio C Hamano
2d8bed969d fetch-pack: brown paper bag fix
When I applied Linus's patch from the list by hand somehow I ended
up reversing the logic by mistake.  This fixes it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-30 11:42:05 -07:00
Jeff King
8d308b3540 Documentation: point git-prune users to git-gc
Most users should be using git-gc instead of directly
calling prune. For those who really do want more information
on pruning, let's point them at git-fsck, which goes into
slightly more detail on reachability.

And since we're pointing users there, let's make sure
reflogs are mentioned in git-fsck(1).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-29 23:11:57 -07:00
Liu Yubao
302cc11a32 Documentation on --git-dir and --work-tree 2008-04-29 23:11:57 -07:00
Heikki Orsila
0104ca09e3 Make read_in_full() and write_in_full() consistent with xread() and xwrite()
xread() and xwrite() return ssize_t values as their native POSIX
counterparts read(2) and write(2).

To be consistent, read_in_full() and write_in_full() should also return
ssize_t values.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-29 23:11:57 -07:00
Richard Quirk
9f1915d393 Documentation gitk: Describe what --merge does
Signed-off-by: Richard Quirk <richard.quirk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-29 23:11:57 -07:00
Alex Riesen
97ad535b01 Use the modern syntax of git-diff-files in t2002-checkout-cache-u.sh
As a nice side effect it also fixes t2002-checkout-cache-u.sh on FreeBSD 4,
/bin/sh of which has problems interpreting "! command" construction.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-29 23:11:57 -07:00
Jon Loeliger
4fe86488e1 Add otherwise missing --strict option to unpack-objects summary.
Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-29 23:11:57 -07:00
Matthieu Moy
59b0c24daa git-svn: detect and fail gracefully when dcommitting to a void
The command

  git svn clone (URL of an empty SVN repo here)

works, creates an empty git repository. I can perform the initial
commit there, but then, "git svn dcommit" says :

Use of uninitialized value in concatenation (.) or string at .../git-svn line 414.
Committing to  ...
Unable to determine upstream SVN information from HEAD history

I guess a correct management of the initial commit in git-svn would be
hard to implement, but at least, the error message can be improved.
First step is something like the patch below, and better would be for
"git svn clone" to warn that it won't be able to do much with the
cloned repo.

Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-29 23:11:57 -07:00
Bart Trojanowski
c8af1de9cf make git-status use a pager
make git status act similar to git log and git diff by presenting long
output in a pager.

Signed-off-by: Bart Trojanowski <bart@jukie.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-29 23:11:57 -07:00
Junio C Hamano
68951af30c Merge branch 'maint'
* maint:
  cvsimport: always pass user data to "system" as a list
  fix reflog approxidate parsing bug
  Fix use after free() in builtin-fetch
  fetch-pack: do not stop traversing an already parsed commit
  Use "=" instead of "==" in condition as it is more portable
2008-04-29 23:06:30 -07:00
Junio C Hamano
30c0312fd1 Merge branch 'maint-1.5.4' into maint
* maint-1.5.4:
  cvsimport: always pass user data to "system" as a list
  fix reflog approxidate parsing bug
2008-04-29 22:55:07 -07:00
Jeff King
b3bb5f76e6 cvsimport: always pass user data to "system" as a list
This avoids invoking the shell. Not only is it faster, but
it prevents the possibility of interpreting our arguments in
the shell.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-29 22:45:27 -07:00
Jeff King
861f00e349 fix reflog approxidate parsing bug
In get_sha1_basic, we parse a string like

  HEAD@{10 seconds ago}:path/to/file

into its constituent ref, reflog date, and path components.
We never actually munge the string itself, but instead keep
offsets into the string with their associated lengths.

When we call approxidate on the contents inside braces,
however, we pass just a string without a length. This means
that approxidate could sometimes look past the closing brace
and (erroneously) interpret the rest of the string as part
of the date.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-29 22:22:19 -07:00
Miklos Vajna
33c592ddd5 Add tests for sendemail.cc configuration variable
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-29 19:56:26 -07:00
Miklos Vajna
5f8b9fcd03 git-send-email: add a new sendemail.cc configuration variable
Some projects prefer to always CC patches to a given mailing list. In
these cases, it's handy to configure that address once.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-29 19:56:26 -07:00
Miklos Vajna
fe8928e6e8 git-format-patch: add a new format.cc configuration variable
Some projects prefer to always CC patches to a given mailing list. In
these cases, it's handy to configure that address once.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-29 19:56:25 -07:00
Alex Riesen
7b7f39eae6 Fix use after free() in builtin-fetch
As reported by Dave Jones:

Since master.kernel.org updated to latest, I noticed that I could crash
git-fetch by doing this..

export KERNEL=/pub/scm/linux/kernel/git/
git fetch $KERNEL/torvalds/linux-2.6 master:linus

(gdb) bt
 0  0x000000349fd6d44b in free () from /lib64/libc.so.6
 1  0x000000000048f4eb in transport_unlock_pack (transport=0x7ce530) at transport.c:811
 2  0x000000349fd31b25 in exit () from /lib64/libc.so.6
 3  0x00000000004043d8 in handle_internal_command (argc=3, argv=0x7fffea4449f0) at git.c:379
 4  0x0000000000404547 in main (argc=3, argv=0x7fffea4449f0) at git.c:443
 5  0x000000349fd1c784 in __libc_start_main () from /lib64/libc.so.6
 6  0x0000000000403ef9 in ?? ()
 7  0x00007fffea4449d8 in ?? ()
 8  0x0000000000000000 in ?? ()

I then remembered, my .bashrc has this..

export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))

which is handy for showing up such bugs.

More info on this glibc feature is at http://udrepper.livejournal.com/11429.html

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-28 23:57:47 -07:00
Linus Torvalds
72269ad956 fetch-pack: do not stop traversing an already parsed commit
f3ec549 (fetch-pack: check parse_commit/object results, 2008-03-03)
broke common ancestor computation by stopping traversal when it sees
an already parsed commit.  This should fix it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-28 16:27:49 -07:00
Alex Riesen
e42251a221 Use "=" instead of "==" in condition as it is more portable
At least the dash from Ubuntu's /bin/sh says:

    test: 233: ==: unexpected operator

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-28 15:03:28 -07:00
Heikki Orsila
f0ec47b8e7 Die for an early EOF in a file reading loop
The resulting data is zero terminated after the read loop, but
the subsequent loop that scans for '\n' will overrun the buffer.

Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-27 22:24:55 -07:00
Heikki Orsila
e8729f5380 Document functions xmemdupz(), xread() and xwrite()
Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-27 22:22:14 -07:00
Junio C Hamano
633d1fe9d0 Merge branch 'maint'
* maint:
  clone: detect and fail on excess parameters
  Remove 'header' from --signoff option description
2008-04-27 21:47:51 -07:00
Junio C Hamano
a2b26acd7a clone: detect and fail on excess parameters
"git clone [options] $src $dst excess-garbage" simply ignored
excess-garbage without giving any diagnostic message.  Fix it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-27 21:47:39 -07:00
Junio C Hamano
5736a37471 Merge branch 'maint-1.5.4' into maint
* maint-1.5.4:
  Remove 'header' from --signoff option description
2008-04-27 21:47:38 -07:00
Dan McGee
362b0dd523 Remove 'header' from --signoff option description
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-27 21:46:51 -07:00