Commit graph

25095 commits

Author SHA1 Message Date
Junio C Hamano f5bf1b5f6b Merge branch 'jh/dirstat' into maint
* jh/dirstat:
  --dirstat: In case of renames, use target filename instead of source filename
  Teach --dirstat not to completely ignore rearranged lines within a file
  --dirstat-by-file: Make it faster and more correct
  --dirstat: Describe non-obvious differences relative to --stat or regular diff
2011-05-04 14:59:07 -07:00
Junio C Hamano 419272d87b Merge branch 'sp/maint-clear-postfields' into maint
* sp/maint-clear-postfields:
  http: clear POSTFIELDS when initializing a slot
2011-05-04 14:58:56 -07:00
Junio C Hamano be44a20aa8 Merge branch 'jk/maint-stash-oob' into maint
* jk/maint-stash-oob:
  stash: fix false positive in the invalid ref test.
  stash: fix accidental apply of non-existent stashes

Conflicts:
	t/t3903-stash.sh
2011-05-04 14:58:42 -07:00
Junio C Hamano 476e42422d Merge branch 'jk/maint-upload-pack-shallow' into maint
* jk/maint-upload-pack-shallow:
  upload-pack: start pack-objects before async rev-list
2011-05-04 14:58:13 -07:00
Junio C Hamano e9f1878da7 Merge branch 'dm/stash-k-i-p' into maint
* dm/stash-k-i-p:
  stash: ensure --no-keep-index and --patch can be used in any order
  stash: add two more tests for --no-keep-index
2011-05-04 14:57:49 -07:00
Junio C Hamano f28d2e33c6 Merge branch 'jc/pack-objects-bigfile' into maint
* jc/pack-objects-bigfile:
  Teach core.bigfilethreashold to pack-objects
2011-05-04 14:57:38 -07:00
Junio C Hamano f6bfe76714 Merge branch 'mg/reflog-with-options' into maint
* mg/reflog-with-options:
  reflog: fix overriding of command line options
  t/t1411: test reflog with formats
  builtin/log.c: separate default and setup of cmd_log_init()
2011-05-04 14:57:33 -07:00
Junio C Hamano 0752000c2a Merge branch 'jk/stash-loosen-safety' into maint
* jk/stash-loosen-safety:
  stash: drop dirty worktree check on apply
2011-05-04 14:57:15 -07:00
Junio C Hamano 391b493344 Merge branch 'ar/clean-rmdir-empty' into maint
* ar/clean-rmdir-empty:
  clean: unreadable directory may still be rmdir-able if it is empty
2011-05-04 14:57:06 -07:00
Junio C Hamano a3402c18b6 Merge branch 'mg/sha1-path-advise' into maint
* mg/sha1-path-advise:
  sha1_name: Suggest commit:./file for path in subdir
  t1506: factor out test for "Did you mean..."
2011-05-04 14:56:51 -07:00
Valentin Haenel d022443604 git-add.txt: document 'add.ignoreErrors'
Signed-off-by: Valentin Haenel <valentin.haenel@gmx.de>
Noticed-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-04 14:52:30 -07:00
Junio C Hamano 65f13f20bc Start 1.7.5.1 maintenance track
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-29 11:47:35 -07:00
Junio C Hamano 04a67dc622 Merge branch 'mg/x-years-12-months' into maint
* mg/x-years-12-months:
  date: avoid "X years, 12 months" in relative dates
2011-04-29 11:43:18 -07:00
Sylvain Rabot a1dd7e16ad git-send-email: fix missing space in error message
When the command cannot make a connection to the SMTP server the error
message to diagnose the broken configuration is issued.  However, when an
optional smtp-server-port is given and needs to be reported, the message
lacked a space between "hello=<smtp-domain>" and "port=<smtp-server-port>".

Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-29 11:34:32 -07:00
Junio C Hamano 1e41827d2d http: clear POSTFIELDS when initializing a slot
After posting a short request using CURLOPT_POSTFIELDS, if the slot
is reused for posting a large payload, the slot ends up having both
POSTFIELDS (which now points at a random garbage) and READFUNCTION,
in which case the curl library tries to use the stale POSTFIELDS.

Clear it as part of the general slot initialization in get_active_slot().

Heavylifting-by: Shawn Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Shawn Pearce <spearce@spearce.org>
2011-04-26 10:44:33 -07:00
Junio C Hamano ec014eac0e Git 1.7.5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-23 23:36:32 -07:00
Michael J Gruber f1e9c548ce date: avoid "X years, 12 months" in relative dates
When relative dates are more than about a year ago, we start
writing them as "Y years, M months".  At the point where we
calculate Y and M, we have the time delta specified as a
number of days. We calculate these integers as:

  Y = days / 365
  M = (days % 365 + 15) / 30

This rounds days in the latter half of a month up to the
nearest month, so that day 16 is "1 month" (or day 381 is "1
year, 1 month").

We don't round the year at all, though, meaning we can end
up with "1 year, 12 months", which is silly; it should just
be "2 years".

Implement this differently with months of size

  onemonth = 365/12

so that

  totalmonths = (long)( (days + onemonth/2)/onemonth )
  years = totalmonths / 12
  months = totalmonths % 12

In order to do this without floats, we write the first formula as

  totalmonths = (days*12*2 + 365) / (365*2)

Tests and inspiration by Jeff King.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-20 19:23:16 -07:00
Junio C Hamano 6ceb270ce6 Git 1.7.5-rc3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-19 11:51:00 -07:00
Junio C Hamano 0e73bb4dfc Sync with 1.7.4.5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-19 11:49:13 -07:00
Junio C Hamano 4fec83045b Git 1.7.4.5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-19 11:45:38 -07:00
Michael J Gruber ccc2fcf54c git-svn.txt: Document --mergeinfo
6abd933 (git-svn: allow the mergeinfo property to be set, 2010-09-24)
introduced the --mergeinfo option. Document it.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-19 11:29:45 -07:00
Junio C Hamano 60e199c4d5 Revert "run-command: prettify -D_FORTIFY_SOURCE workaround"
This reverts commit ebec842773, which
somehow mistakenly thought that any non-zero return from write(2) is
an error.
2011-04-18 14:14:53 -07:00
Junio C Hamano 4d8b32a2e1 Merge branch 'maint'
* maint:
  archive: document limitation of tar.umask config setting
  t3306,t5304: avoid clock skew issues
  git.txt: fix list continuation
2011-04-14 12:26:45 -07:00
René Scharfe 810cae53e0 archive: document limitation of tar.umask config setting
The local value of the config variable tar.umask is not passed to the
other side with --remote.  We may want to change that, but for now just
document this fact.

Reported-by: Jacek Masiulaniec <jacek.masiulaniec@gmail.com>
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-14 12:24:02 -07:00
Michael J Gruber e3b02bc953 t3306,t5304: avoid clock skew issues
On systems where the local time and file modification time may be out of
sync (e.g. test directory on NFS) t3306 and t5305 can fail because prune
compares times such as "now" (client time) with file modification times
(server times for remote file systems). I.e., these are spurious test
failures.

Avoid this by setting the relevant modification times to the local time.

Noticed on a system with as little as 2s time skew.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-14 10:47:18 -07:00
Michael J Gruber fd5858b49b git.txt: fix list continuation
Remove a spurious empty line which prevented asciidoc from recognizing a
list continuation mark ('+'), so that it does not get output literally any
more.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-14 09:19:51 -07:00
Junio C Hamano 865d370c4d Git 1.7.5-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-13 14:02:00 -07:00
Junio C Hamano 6c4c9bdc98 Merge branch 'maint'
* maint:
2011-04-13 13:59:19 -07:00
Junio C Hamano 06ff44951a Merge branch 'jc/rev-list-options-fix' into maint
* jc/rev-list-options-fix:
  "log --cherry-pick" documentation regression fix
2011-04-13 13:56:52 -07:00
Junio C Hamano 302de7a685 Merge branch 'js/checkout-untracked-symlink' into maint
* js/checkout-untracked-symlink:
  t2021: mark a test as fixed
2011-04-13 13:55:53 -07:00
Jim Meyering 0353a0c4ec remove doubled words, e.g., s/to to/to/, and fix related typos
I found that some doubled words had snuck back into projects from which
I'd already removed them, so now there's a "syntax-check" makefile rule in
gnulib to help prevent recurrence.

Running the command below spotted a few in git, too:

  git ls-files | xargs perl -0777 -n \
    -e 'while (/\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt])\s+\1\b/gims)' \
    -e '{$n=($` =~ tr/\n/\n/ + 1); ($v=$&)=~s/\n/\\n/g;' \
    -e 'print "$ARGV:$n:$v\n"}'

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-13 11:59:11 -07:00
Ramkumar Ramachandra 5e31075a19 revert: Hide '-r' option in default usage
The '-r' command-line option is a no-op provided only for backward
compatiblity since abd6970 (cherry-pick: make -r the default, 2006-10-05),
and somehow ended up surviving across reimplementation in C at 9509af6
(Make git-revert & git-cherry-pick a builtin, 2007-03-01) and another
rewrite of the command line parser at f810379 (Make builtin-revert.c use
parse_options, 2007-10-07).  We should have stopped advertising the option
long time ago.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-13 11:02:49 -07:00
Johan Herland 2ca8671470 --dirstat: In case of renames, use target filename instead of source filename
This changes --dirstat analysis to count "damage" toward the target filename,
rather than the source filename. For renames within a directory, this won't
matter to the final output, but when moving files between diretories, the
output now lists the target directory rather than the source directory.

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-12 11:29:34 -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
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
Æ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 981ff5c37a 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
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