Commit Graph

28620 Commits

Author SHA1 Message Date
Jonathan Nieder
5c9096f747 gitk: Use symbolic font names "sans" and "monospace" when available
The following only concerns systems using X and the client-side font
rendering framework from freedesktop.org.  Windows and Mac OS X are
not affected.

Starting with version 8.5, Tk uses freetype and fontconfig by default
to render fonts on platforms that support it.  Gitk currently defaults
to the font Helvetica for the interface and Courier for diffs, and
both unfortunately look rather bad on screen in the default
configuration on many Linux distros with anti-aliasing and poor
hinting.

It is better to default to "sans" and "monospace", which are mapped by
fontconfig to some appropriate font of the sysadmin and user's
choosing (typically Bitstream Vera Sans and Mono).  The result looks
more sensible and it makes gitk feel like a well-behaved software
citizen since its fonts match other native apps.

This patch does not change the appearance of gitk for users that have
already run it, since gitk uses the remembered UI and diff font names
from ~/.gitk.

Requested-by: Michael Biebl <biebl@debian.org>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Acked-by: Mark Hills <mark@pogo.org.uk>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2012-03-19 10:23:43 +11:00
Frédéric Brière
585c27cb22 gitk: Skip over AUTHOR/COMMIT_DATE when searching all fields
This prevents a search for a number like "105" on "All Fields" from
matching against the raw author and commit timestamps.  These
timestamps were already not searchable by themselves, and the
displayed format does not match the query string anyway.

Signed-off-by: Frédéric Brière <fbriere@fbriere.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2012-03-19 10:23:43 +11:00
Jim Meyering
6c9e2d1842 gitk: Make "git describe" output clickable, too
Automake's contribution guidelines suggest using "git describe" output
in commit logs to reference previous commits.  By contrast, in
coreutils, I had acquired the habit of using a bare SHA1 prefix (8 hex
digits), since gitk creates clickable links for that, and not for "git
describe" output.

I prefer the readability of the full "git describe" output, yet want
to retain the gitk links, so this renders as clickable not just
SHA1-like strings, but also an SHA1-like string that is prefixed by
"-g".

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2012-03-19 10:16:53 +11:00
Pat Thoyts
65bb0bda75 gitk: Fix the display of files when filtered by path
Launching 'gitk -- .' or 'gitk -- ..\t' restricts the display to files
under the given directory but the file list is left empty. This is because
the path_filter function fails to match the filenames which are relative
to the working tree to the filter which is filessytem relative.
This solves the problem by making both names fully qualified filesystem
paths before performing the comparison.

Tested-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2012-03-19 10:10:59 +11:00
Pat Thoyts
44acce0bef gitk: Use a tabbed dialog to edit preferences
This commit converts the user preferences dialog into a tabbed property
sheet grouping general properties, colours and font selections onto
separate pages. The previous implementation was exceeding the screen
height on some systems and this avoids such problems and permits extension
using new pages in the future.

If themed Tk is unavailable or undesired a reasonable facsimile of the
tabbed notebook widget is used instead.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2012-03-19 10:04:43 +11:00
Zbigniew Jędrzejewski-Szmek
3878e636c6 gitk: Use "gitk: repo-top-level-dir" as window title
Previously, when run in a subdirectory, gitk would show the name
of this subdirectory as title, which was misleading. When run with
GIT_DIR set, it would show the cwd, which is even more misleading.

In case of non-bare repos, the .git suffix in the path is skipped.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
2012-03-19 10:00:22 +11:00
Junio C Hamano
f524129737 Merge branch 'ab/perl-i18n'
* ab/perl-i18n:
  perl/Makefile: install Git::I18N under NO_PERL_MAKEMAKER
  Git::I18N: compatibility with perl <5.8.3
2012-03-16 09:16:17 -07:00
Ævar Arnfjörð Bjarmason
5eb660ecd1 perl/Makefile: install Git::I18N under NO_PERL_MAKEMAKER
When I added the i18n infrastructure in v1.7.8-rc2-1-g5e9637c I forgot
to install Git::I18N also when NO_PERL_MAKEMAKER=YesPlease was
set. Change the generation of the fallback perl.mak file to do that.

Now Git/I18N.pm is installed alongside Git.pm in such a way that
anything that uses GITPERLLIB will find it.

Reported-by: Tom G. Christensen <tgc@statsbiblioteket.dk>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-16 09:15:28 -07:00
Junio C Hamano
bc62ca13c0 Update draft release notes to 1.7.10
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-16 08:42:22 -07:00
Junio C Hamano
0987145dd3 Merge branch 'th/mergetools-deltawalker'
* th/mergetools-deltawalker:
  Documentation/difftool: add deltawalker to list of valid diff tools
2012-03-16 08:24:20 -07:00
Junio C Hamano
c3117b2166 Merge branch 'jc/maint-verify-objects-remove-pessimism'
The code to validate the history connectivity between old refs and new
refs used by fetch and receive-pack, introduced in 1.7.8, was grossly
inefficient and unnecessarily tried to re-validate integrity of individual
objects. This essentially reverts that performance regression.

* jc/maint-verify-objects-remove-pessimism:
  fetch/receive: remove over-pessimistic connectivity check
2012-03-16 08:23:53 -07:00
Junio C Hamano
9721d2fb10 Merge branch 'sl/customize-sane-tool-path'
* sl/customize-sane-tool-path:
  configure: allow user to prevent $PATH "sanitization" on Solaris
2012-03-16 08:23:35 -07:00
Junio C Hamano
5087aace2d two fixes for fast-import's "ls" command
Andrew Sayers noticed that the svn-fe | git fast-import pipeline
 mishandles a subversion history that copies the root directory to a
 sub-directory (e.g. doing `svn cp . trunk` to standardise your
 layout).  As David Barr explained, the bug arises when the following
 command is sent to git fast-import:
 
   'ls' SP ':1' SP LF
 
 Instead of reading back what is at the root of r1, it unconditionally
 reports the path as missing.
 
 After sleeping on it, here are two patches for 'maint'.  One plugs a
 memory leak.  The other ensures that trying to pass an empty path to
 the 'ls' command results in an error message that can help the
 frontend author instead of the silently broken conversion Andrew
 found.
 
 Then we can carefully add 'ls ""' support in 1.7.11.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIbBAABCAAGBQJPWtgPAAoJEN/Gce6zM/olpU4P92DnurNCuUOsCIOVvEHT7YC+
 JdBou7wDKug2U0XH4yvTCglJZQ+zWpoobPoJlGu4c+RPWYGoUnOvc2jUmhFGD2r4
 jLlNhq3Uob4CSdEA8JLz8IOvgW41kc2LuUsZrr19dC3eS/19U72NQpD5nA958wZw
 xmvcu1DjhrsYHSdh4azg0Ccsp3PzesssCGJSckKoYpOZSlbznK3Dyn2KnLPZvAmx
 fF6uyPAZXKsKDOyVUPczIQ+mitb5YhOa3eFDcZk/EBM1LUCqbE0qmFyPhFqtE2pP
 f0BcG2MwXc6S8FIRTSkzxV3WP8Cl5+3Y3LX+aB9Y5Zl7Vx1LBdDEhEZS0DkJFW1u
 c/64Ge89FD/mSKpJfu8iZdga+qalyF1u5fPPFvOKV3p6UO1ou1RuIVEDMUhMzPhi
 244i7VnaPq232aMr8Jn4eAnpg+mZpOdDuqsJn4Q/BOpJ2D5UmKzja4LUZk2tkmgh
 EzGYLbs//TZXKjeNGH1rBdbW9lO0fU8oGRaTKiRwWTQVAJ48hUlOYfMBsWvUnvI6
 A5ar/iT8UthEc54OZIkBefjpFrwIXl3wG1iafDY8Z1rcnGsbH9MpNFLFxcoGQTBJ
 9A6ZyqL7dEKg2SWfESXf93xkF/fFZYl+0jFm+VNuJUzkrsvoi4tkxs/3qxaE74Kb
 zQtYbp/z+KWFh4eg830=
 =wrup
 -----END PGP SIGNATURE-----

Merge "two fixes for fast-import's 'ls' command" from Jonathan

Andrew Sayers noticed that the svn-fe | git fast-import pipeline
mishandles a subversion history that copies the root directory to a
sub-directory (e.g. doing `svn cp . trunk` to standardise your
layout).  As David Barr explained, the bug arises when the following
command is sent to git fast-import:

  'ls' SP ':1' SP LF

Instead of reading back what is at the root of r1, it unconditionally
reports the path as missing.

After sleeping on it, here are two patches for 'maint'.  One plugs a
memory leak.  The other ensures that trying to pass an empty path to
the 'ls' command results in an error message that can help the
frontend author instead of the silently broken conversion Andrew
found.

Then we can carefully add 'ls ""' support in 1.7.11.

* commit 'refs/pull-request-tags/jn/maint-fast-import-empty-ls':
  fast-import: don't allow 'ls' of path with empty components
  fast-import: leakfix for 'ls' of dirty trees
2012-03-16 08:19:18 -07:00
Jiang Xin
dac1de7de5 l10n: Update zh_CN translation for Git 1.7.10-rc1
Translate 1 new message from Git 1.7.10-rc1: "Gitdir '$a' is ..."

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2012-03-16 22:35:58 +08:00
Jiang Xin
a2c01b55ff l10n: Update git.pot (1 new message)
Changes of po/git.pot from v1.7.10-rc0 to v1.7.10-rc1:

 * 1 new l10n message at line: 3361.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2012-03-16 20:32:59 +08:00
Jiang Xin
d90b16ed42 Git 1.7.10-rc1
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.10 (GNU/Linux)
 
 iQIcBAABAgAGBQJPYSAWAAoJELC16IaWr+bLmQoQAIumrgZlezaE49Y08TPVjNzI
 BtZ2et503qpHCyIWhn68rgiDWuZL1OKfCXAPcptuqb92Fk0TlRshEGjg8aMPAIdT
 CxtQPde0d+t60l961s9kyNxeSuYFWqNjB9GtO/AvY8kpfZ+FTZTS7UA5OdMBgTdm
 IQBQMvf02tT68EvPZoZ1wqddU8KLiimbxvrzaMYrO1CjYvKUUSLmzxNbIUNhF/B1
 +r6RsFl8gnUfxa3+HEv1WFeKoBTSoPix6e+odF9tTekB+Fza8n9cH7qxXsgtnOAu
 3KsAa+K24tOFR8OEBzUNdRYk4fJs5dmZB/kIEiiU2CVvAqpTy58imdk9d0OmKhSR
 kBQVcATbgz5aUQtlvuoYaV//aiSAA0eGvGgRP47a9he935wkfbmfFQonuUxgGvI4
 zMMa7N6oLko0P9IN/DgLyz/D+LwMyjqpTxLVt2CrEMh68nTAU0prnEy/gxIdwRUJ
 9Jv4BkNBudqj8jbIpkU0+iI598yCCOh9aw7begEYed84wcceMzPlAtC7rwROYhtw
 lf0P/pxWAfj3iOtESFVmSkWMz+MYOWA2fr5wxX8FtWDBFZ2W2mnSy1kNkHNMLo/j
 4QvIsRqxS661WOzDIehNh8F2Mng1bxy08vLR4LaEhIVy+Qb07ziZcUkIFYdhMblf
 d3x9jhNo36QSk8gWhVxE
 =TGu1
 -----END PGP SIGNATURE-----

Merge v1.7.10-rc0 for git l10n update
2012-03-16 20:18:07 +08:00
Junio C Hamano
a99c5e5921 Merge branch 'th/git-diffall'
* th/git-diffall:
  contrib/diffall: fix cleanup trap on Windows
  contrib/diffall: eliminate duplicate while loops
  contrib/diffall: eliminate use of tar
  contrib/diffall: create tmp dirs without mktemp
  contrib/diffall: comment actual reason for 'cdup'
2012-03-15 21:54:42 -07:00
Junio C Hamano
c58499c317 Merge branch 'th/doc-diff-submodule-option'
* th/doc-diff-submodule-option:
  Documentation/diff-options: reword description of --submodule option
2012-03-15 21:54:31 -07:00
Junio C Hamano
d21c463d55 fetch/receive: remove over-pessimistic connectivity check
Git 1.7.8 introduced an object and history re-validation step after
"fetch" or "push" causes new history to be added to a receiving
repository. This is to protect a malicious server or pushing client from
corrupting the repository by taking advantage of an existing corrupt
object that is unconnected to existing history.

But this check is way over-pessimistic.  During "fetch" or "receive-pack"
(the server side of "push"), unpack-objects and index-pack already
validate individual objects that are received, and the only thing we would
want to catch are corrupted objects that already happen to exist in our
repository but are not referenced from our refs.  Such objects must have
been written by an earlier run of our codepaths that write out loose
objects or packfiles, and they must have done the validation of individual
objects when they did so.  The only thing left to worry about is the
connectivity integrity, which can be checked with "rev-list --objects",
which is much cheaper.  We have been paying the 5x to 8x runtime overhead
the --verify-objects often adds for no real gain.

Revert check_everything_connected() not to use this over-pessimistic
check.

Credit goes to Nguyễn Thái Ngọc Duy, who originally identified the
performance regression and endured multiple rounds of reviews to fix it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-15 15:23:17 -07:00
Tim Henigan
79e0fe6348 Documentation/difftool: add deltawalker to list of valid diff tools
deltawalker has been supported since 284a126c3e, but was not added
to the list of valid diff tools reported by 'git difftool --help'.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-15 13:53:39 -07:00
Junio C Hamano
ae2f203ef7 clean: preserve nested git worktree in subdirectories
remove_dir_recursively() has a check to avoid removing the directory it
was asked to remove without recursing into it and report success when the
directory is the top level of a working tree of a nested git repository,
to protect such a repository from "clean -f" (without double -f). If a
working tree of a nested git repository is in a subdirectory of a toplevel
project, however, this protection did not apply by mistake; we forgot to
pass the REMOVE_DIR_KEEP_NESTED_GIT down to the recursive removal
codepath.

This requires us to also teach the higher level not to remove the
directory it is asked to remove, when the recursed invocation did not
remove the directory it was asked to remove due to a nested git
repository, as it is not an error to leave the parent directories of such
a nested repository.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-15 11:25:34 -07:00
Johan Herland
dabba590aa notes-merge: Don't remove .git/NOTES_MERGE_WORKTREE; it may be the user's cwd
When a manual notes merge is committed or aborted, we need to remove the
temporary worktree at .git/NOTES_MERGE_WORKTREE. However, removing the
entire directory is not good if the user ran the 'git notes merge
--commit/--abort' from within that directory. On Windows, the directory
removal would simply fail, while on POSIX systems, users would suddenly
find themselves in an invalid current directory.

Therefore, instead of deleting the entire directory, we delete everything
_within_ the directory, and leave the (empty) directory in place.

This would cause a subsequent notes merge to abort, complaining about a
previous - unfinished - notes merge (due to the presence of
.git/NOTES_MERGE_WORKTREE), so we also need to adjust this check to only
trigger when .git/NOTES_MERGE_WORKTREE is non-empty.

Finally, adjust the t3310 manual notes merge testcases to correctly handle
the existence of an empty .git/NOTES_MERGE_WORKTREE directory.

Inspired-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-15 11:13:23 -07:00
Johan Herland
a0be62c100 notes-merge: use opendir/readdir instead of using read_directory()
notes_merge_commit() only needs to list all entries (non-recursively)
under a directory, which can be easily accomplished with
opendir/readdir and would be more lightweight than read_directory().

read_directory() is designed to list paths inside a working
directory. Using it outside of its scope may lead to undesired effects.

Apparently, one of the undesired effects of read_directory() is that it
doesn't deal with being given absolute paths. This creates problems for
notes_merge_commit() when git_path() returns an absolute path, which
happens when the current working directory is in a subdirectory of the
.git directory.

Originally-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Updated-by:  Johan Herland <johan@herland.net>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-15 11:13:23 -07:00
Johan Herland
01bfec8e52 t3310: illustrate failure to "notes merge --commit" inside $GIT_DIR/
The 'git notes merge' command expected to be run from the working
tree of the project being annotated, and did not anticipate getting
run inside $GIT_DIR/.

However, because we use $GIT_DIR/NOTES_MERGE_WORKTREE as a temporary
working space for the user to work on resolving conflicts, it is not
unreasonable for a user to run "git notes merge --commit" there. But
the command fails to do so.

Found-by: David Bremner <david@tethera.net>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-15 11:13:23 -07:00
Junio C Hamano
c844a80356 remove_dir_recursively(): Add flag for skipping removal of toplevel dir
Add the REMOVE_DIR_KEEP_TOPLEVEL flag to remove_dir_recursively() for
deleting everything inside the given directory, but _not_ the given
directory itself.

Note that this does not pass the REMOVE_DIR_KEEP_NESTED_GIT flag, if set,
to the recursive invocations of remove_dir_recursively().  It is likely to
be a a bug that has been present since REMOVE_DIR_KEEP_NESTED_GIT was
introduced (a0f4afb), but this commit keeps the same behaviour for now.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-15 11:12:25 -07:00
Zbigniew Jędrzejewski-Szmek
6c556cb8e6 t0303: resurrect commit message as test documentation
The commit message which added those tests (861444f 't: add test
harness for external credential helpers' 2011-12-10) provided nice
documentation in the commit message. Let's make it more visible
by putting it in the test description.

The documentation is updated to reflect the fact that
GIT_TEST_CREDENTIAL_HELPER must be set for
GIT_TEST_CREDENTIAL_HELPER_TIMEOUT to be used
and GIT_TEST_CREDENTIAL_HELPER_SETUP can be used.

Based-on-commit-message-by: Jeff King <peff@peff.net>
Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-15 10:50:58 -07:00
Zbigniew Jędrzejewski-Szmek
16e44810c9 t0303: immediately bail out w/o GIT_TEST_CREDENTIAL_HELPER
t0300-credential-helpers.sh requires GIT_TEST_CREDENTIAL_HELPER to be
configured to do something sensible. If it is not set, prove will say:
  ./t0303-credential-external.sh .. skipped: (no reason given)
which isn't very nice.

Use skip_all="..." && test_done to bail out immediately and provide a
nicer message. In case GIT_TEST_CREDENTIAL_HELPER is set, but the
timeout tests are skipped, mention GIT_TEST_CREDENTIAL_HELPER_TIMEOUT.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-15 10:50:45 -07:00
Junio C Hamano
0e2d57fd50 Git 1.7.10-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-14 15:47:45 -07:00
Tim Henigan
bfe392e367 contrib/diffall: fix cleanup trap on Windows
Prior to this commit, the cleanup trap that removes the tmp dir
created by the script would fail on Windows. The error was silently
ignored by the script.

On Windows, a directory cannot be removed while it is the working
directory of the process (thanks to Johannes Sixt on the Git list
for this info [1]).

This commit eliminates the 'cd' into the tmp directory that caused
the error.

[1]: http://article.gmane.org/gmane.comp.version-control.git/193086

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-14 15:22:38 -07:00
Tim Henigan
97549084f6 contrib/diffall: eliminate duplicate while loops
There were 3 instances of a 'while read; do' that used identical logic
to populate '/tmp/right_dir'. This commit groups them into a single loop.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-14 15:22:08 -07:00
Tim Henigan
e33e01d077 contrib/diffall: eliminate use of tar
The 'tar' utility is not available on all platforms (some only support
'gnutar').  An earlier commit created a work-around for this problem,
but a better solution is to eliminate the use of 'tar' completely.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-14 15:20:25 -07:00
Tim Henigan
c5770f7906 contrib/diffall: create tmp dirs without mktemp
mktemp is not available on all platforms.  Instead of littering the code
with a work-around, this commit replaces mktemp with a one-line Perl
script.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-14 15:20:21 -07:00
Tim Henigan
a22a9477fc contrib/diffall: comment actual reason for 'cdup'
The comment from an earlier commit did not reflect the actual reason this
operation is needed.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-14 15:19:55 -07:00
Thomas Rast
6440d3417c diff: tweak a _copy_ of diff_options with word-diff
When using word diff, the code sets the word_regex from various
defaults if it was not set already.  The problem is that it does this
on the original diff_options, which will also be used in subsequent
diffs.

This means that when the word_regex is not given on the command line,
only the first diff for which a setting for word_regex (either from
attributes or diff.wordRegex) ever takes effect.  This value then
propagates to the rest of the diff runs and in particular prevents
further attribute lookups.

Fix the problem of changing diff state once and for all, by working
with a _copy_ of the diff_options.

Noticed-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-14 14:41:20 -07:00
Thomas Rast
77d1a520fb diff: refactor the word-diff setup from builtin_diff_cmd
Quite a chunk of builtin_diff_cmd deals with word-diff setup, defaults
and such.  This makes the function a bit hard to read, but is also
asymmetric because the corresponding teardown lives in free_diff_words_data
already.

Refactor into a new function init_diff_words_data.  For simplicity,
also shuffle around some functions it depends on.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-14 14:40:15 -07:00
Johannes Sixt
62d39359af t4034: diff.*.wordregex should not be "sticky" in --word-diff
The test case applies a custom wordRegex to one file in a diff, and expects
that the default word splitting applies to the second file in the diff.
But the custom wordRegex is also incorrectly used for the second file.

Helped-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-14 14:39:01 -07:00
Tim Henigan
3fe271e91b Documentation/diff-options: reword description of --submodule option
The previous description was confusing.  This rewrite makes it easier
to understand.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-14 12:15:46 -07:00
Junio C Hamano
418a1435f1 fmt-merge-msg: show those involved in a merged series
As we already walk the history of the branch that gets merged to
come up with a short log, let's label it with names of the primary
authors, so that the user who summarizes the merge can easily give
credit to them in the log message.

Also infer the names of "lieutents" to help integrators at higher
level of the food-chain to give credit to them, by counting:

 * The committer of the 'tip' commit that is merged
 * The committer of merge commits that are merged

Often the first one gives the owner of the history being pulled, but
his last pull from his sublieutenants may have been a fast-forward,
in which case the first one would not be.  The latter rule will
count the integrator of the history, so together it might be a
reasonable heuristics.

There are two special cases:

 - The "author" credit is omitted when the series is written solely
   by the same author who is making the merge. The name can be seen
   on the "Author" line of the "git log" output to view the log
   message anyway.

 - The "lieutenant" credit is omitted when there is only one key
   committer in the merged branch and it is the committer who is
   making the merge. Typically this applies to the case where the
   developer merges his own branch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-13 20:44:29 -07:00
Jonathan Nieder
6dd88832e7 diffstat summary line varies by locale: miscellany
These changes are in the same spirit as the six patches that
precede them, but they haven't been split into individually
justifiable patches yet.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-13 14:26:33 -07:00
Jonathan Nieder
2983c0e22a test: use numstat instead of diffstat in binary-diff test
git's --stat output is intended for humans and since v1.7.9.2~13
(2012-02-01) varies by locale.  The tests in this script using "apply
--stat" are meant to check two things:

 - how binary file changes are accounted for and printed in
   git's diffstat format

 - that "git apply" can parse the various forms of binary diff

Split these two kinds of check into separate tests, and use --numstat
instead of --stat in the latter.  This way, we lose less test coverage
when git is being run without writing its output in the C locale (for
example because GETTEXT_POISON is enabled) and there are fewer tests
to change if the --stat output needs to be tweaked again.

While at it, use commands separated by && that read and write to
temporary files in place of pipelines so segfaults and other failures
in the upstream of the processing pipeline don't get hidden.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-13 14:26:32 -07:00
Jonathan Nieder
1145211456 test: use --numstat instead of --stat in "git stash show" tests
git's diff --stat output is intended for human consumption and
since v1.7.9.2~13 (2012-02-01) varies by locale.  Add a test checking
that git stash show defaults to --stat and tweak the rest of the
"stash show" tests that showed a diffstat to use numstat.

This way, there are fewer tests to tweak if the diffstat format
changes again.  This also improves test coverage when running tests
with git configured not to write its output in the C locale (e.g.,
via GETTEXT_POISON=Yes).

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-13 14:26:32 -07:00
Jonathan Nieder
2593633f5a test: test cherry-pick functionality and output separately
Since v1.7.3-rc0~26^2~9 (revert: report success when using option
--strategy, 2010-07-14), the cherry-pick-many-commits test checks the
format of output written to the terminal during a cherry-pick sequence
in addition to the functionality.  There is no reason those have to
be checked in the same test, though, and it has some downsides:

 - when progress output is broken, the test result does not convey
   whether the functionality was also broken or not

 - it is not immediately obvious when reading that these checks are
   meant to prevent regressions in details of the output format and
   are not just a roundabout way to check functional details like the
   number of commits produced

 - there is a temptation to include the same kind of output checking
   for every new cherry-pick test, which would make future changes
   to the output unnecessarily difficult

Put the tests from v1.7.3-rc0~26^2~9 in separate assertions, following
the principle "test one feature at a time".

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-13 14:26:32 -07:00
Jonathan Nieder
ef7db1933b test: modernize funny-names test style
This is one of the early tests, so it uses a style that by modern
standards can be hard to read.  Tweak it to:

 - clearly declare what assertion each test is designed to check

 - mark tests that create state later tests will depend on with the
   word "setup" so people writing or running tests know the others
   can be skipped or reordered safely

 - put commands that populate a file with expected output inside
   the corresponding test stanza, so it is easier to see by eye
   where each test begins and ends

 - instead of pipelines, use commands that read and write a
   temporary file, so bugs causing commands to segfault or produce
   the wrong exit status can be caught.

More cosmetic changes:

 - put the opening quote starting each test on the same line as the
   test_expect_* invocation, and indent the commands in each test
   with a single tab

 - end the test early if the underlying filesystem cannot
   accomodate the filenames we use, instead of marking all tests
   with the same TABS_IN_FILENAMES prerequisite.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-13 14:26:32 -07:00
Jonathan Nieder
e7a8ac3875 test: use numstat instead of diffstat in funny-names test
This test script checks that git's plumbing commands quote filenames
with special characters like space, tab, and double-quote
appropriately in their input and output.

Since commit v1.7.9.2~13 (Use correct grammar in diffstat summary
line, 2012-02-01), the final "1 file changed, 1 insertion(+)" line
from diffstats is translatable, meaning tests that rely on exact "git
apply --stat" output have to be skipped when git is not configured to
produce output in the C locale (for example, when GETTEXT_POISON is
enabled).  So:

 - Tweak the three "git apply --stat" tests that check "git apply"'s
   input parsing to use --numstat instead.

   --numstat output is more reliable, does not vary with locale, and
   is itself easier to parse.  These tests are mainly about how "git
   apply" parses its input so this should not result in much loss of
   coverage.

 - Add a new "apply --stat" test to check the quoting in --stat output
   format.

This wins back a little of the test coverage lost with the patch
"test: use test_i18ncmp to check --stat output" when GETTEXT_POISON is
enabled.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-13 14:26:31 -07:00
Jonathan Nieder
fc5877a623 test: use test_i18ncmp when checking --stat output
Ever since v1.7.9.2~13 (2012-02-01), git's diffstat-style summary line
produced by "git apply --stat", "git diff --stat", and "git commit"
varies by locale, producing test failures when GETTEXT_POISON is set.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-13 14:26:27 -07:00
Junio C Hamano
d973dc01cc Merge branch 'jc/i18n-shell-script-gettext'
The auto detection was testing if a fixed string that is known to be
non-empty is empty by mistake.

* jc/i18n-shell-script-gettext:
  i18n: fix auto detection of gettext scheme for shell scripts
2012-03-13 12:36:28 -07:00
Junio C Hamano
8de55e37dd Merge branch 'jc/maint-undefined-i18n-observation-test'
It was unclear what a test in t0204 wanted to check; it turns out
that it was only to observe an undefined behaviour of the system,
and did not anticipate one kind of reasonable error behaviour.

* jc/maint-undefined-i18n-observation-test:
  t0204: clarify the "observe undefined behaviour" test
2012-03-13 12:36:09 -07:00
Junio C Hamano
3f263099fc Merge branch 'ms/maint-config-error-at-eol-linecount'
When "git config" diagnoses an error in a configuration file and
shows the line number for the offending line, it miscounted if the
error was at the end of line.

By Martin Stenberg
* ms/maint-config-error-at-eol-linecount:
  config: report errors at the EOL with correct line number

Conflicts:
	t/t1300-repo-config.sh
2012-03-13 12:35:53 -07:00
Junio C Hamano
9d9bfea8f5 Merge branch 'ph/rerere-doc'
By Phil Hord
* ph/rerere-doc:
  rerere: Document 'rerere remaining'
2012-03-13 12:35:22 -07:00
Junio C Hamano
6c15a1c636 am: officially deprecate -b/--binary option
We have had these options as harmless no-op for more than 3 years without
officially deprecating them.  Let's announce the deprecation and start
warning against their use, but without failing the command just not yet,
so that we can later repurpose the option if we want to in the future.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-13 12:21:04 -07:00