Commit graph

20 commits

Author SHA1 Message Date
Brian Gernhardt c01bd5a29f t/annotate-tests: Use echo & cat instead of sed
The use of the sed command "1i No robots allowed" caused the version
of sed in OS X to die with

   sed: 1: "1i "No robots allowed"\n": command i expects \ followed by
   text

Since this command was just trying to add a single line to the
beginning of the file, do the same with "echo" followed by "cat".

Unbreaks t8001 and t8002 on OS X 10.6.7

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-05 09:24:21 -07:00
Josh Stone 9b01f0038b blame: tolerate bogus e-mail addresses a bit better
The names and e-mails are sanitized by fmt_ident() when creating commits,
so that they do not contain "<" nor ">", and the "committer" and "author"
lines in the commit object will always be in the form:

    ("author" | "committer") name SP "<" email ">" SP timestamp SP zone

When parsing the email part out, the current code looks for SP starting
from the end of the email part, but the author could obfuscate the address
as "author at example dot com".

We should instead look for SP followed by "<", to match the logic of the
side that formats these lines.

Signed-off-by: Josh Stone <jistone@redhat.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-29 11:09:42 -07:00
Junio C Hamano 4ef927a995 Merge branch 'kb/blame-author-email'
* kb/blame-author-email:
  blame: Add option to show author email instead of name

Conflicts:
	t/annotate-tests.sh
2010-11-29 17:52:32 -08:00
Junio C Hamano b3ff808b71 Merge branch 'en/and-cascade-tests'
* en/and-cascade-tests: (25 commits)
  t4124 (apply --whitespace): use test_might_fail
  t3404: do not use 'describe' to implement test_cmp_rev
  t3404 (rebase -i): introduce helper to check position of HEAD
  t3404 (rebase -i): move comment to description
  t3404 (rebase -i): unroll test_commit loops
  t3301 (notes): use test_expect_code for clarity
  t1400 (update-ref): use test_must_fail
  t1502 (rev-parse --parseopt): test exit code from "-h"
  t6022 (renaming merge): chain test commands with &&
  test-lib: introduce test_line_count to measure files
  tests: add missing &&, batch 2
  tests: add missing &&
  Introduce sane_unset and use it to ensure proper && chaining
  t7800 (difftool): add missing &&
  t7601 (merge-pull-config): add missing &&
  t7001 (mv): add missing &&
  t6016 (rev-list-graph-simplify-history): add missing &&
  t5602 (clone-remote-exec): add missing &&
  t4026 (color): remove unneeded and unchained command
  t4019 (diff-wserror): add lots of missing &&
  ...

Conflicts:
	t/t7006-pager.sh
2010-11-24 15:51:49 -08:00
Jonathan Nieder a48fcd8369 tests: add missing &&
Breaks in a test assertion's && chain can potentially hide
failures from earlier commands in the chain.

Commands intended to fail should be marked with !, test_must_fail, or
test_might_fail.  The examples in this patch do not require that.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-09 11:59:49 -08:00
Kevin Ballard 27eea66b28 Update test script annotate-tests.sh to handle missing/extra authors
The current script used by annotate-tests.sh (used by t8001 and t8002) fails
to emit a warning if any of the expected authors never show up in the output
or if authors that show up in the output were never specified as expected.
Update the script to fail in both of these scenarios.

Helped-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-19 14:15:30 -07:00
Kevin Ballard 1b8cdce94f blame: Add option to show author email instead of name
Add a new option -e (or --show-email) to git-blame that will display
the author's email instead of name on each line. This option works
for both git-blame and git-annotate.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-10-19 12:00:28 -07:00
Brandon Casey d8b69ecb4c t/annotate-tests.sh: avoid passing a non-newline terminated file to sed
Some versions of sed exit non-zero if the file they are supplied is not
newline terminated.  Solaris's /usr/xpg4/bin/sed is one such sed.  So
rework this test to avoid doing so.

This affects tests t8001-annotate.sh and t8002-blame.sh.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-05-06 11:50:44 -07:00
Johannes Schindelin 58db64f73c make t8001 work on Mac OS X again
The test was recently broken to expect sed to leave the
incomplete line at the end without newline.

POSIX says that output of the pattern space is to be followed by
a newline, while GNU adds the newline back only when it was
stripped when input.  GNU behaviour is arguably more intuitive
and nicer, but we should not depend on it.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-06 17:09:53 -08:00
Alex Riesen 563b43ee45 Avoid ActiveState Perl IO in t800[12]
Use sed instead, it comes with cygwin and there is almost no chance of
someone installing a sed with default CRLF lineendings by accident.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-07 00:35:15 -08:00
Junio C Hamano cee7f245dc git-pickaxe: blame rewritten.
Currently it does what git-blame does, but only faster.

More importantly, its internal structure is designed to support
content movement (aka cut-and-paste) more easily by allowing
more than one paths to be taken from the same commit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-19 22:42:49 -07:00
Ramsay Allan Jones 1fd4da643c Fix annotate test script; notice when git-annotate fails.
The t8001-annotate.sh test claimed all tests pass, when in fact
the git-annotate perl script failed to run! (prior to fixing the
script to work with perl 5.5).

Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-02 00:27:17 -07:00
Eric Wong 8ff99e7417 tests: Set EDITOR=: and VISUAL=: globally
This way we don't have to remember to set it for each test; and
if we forget, we won't cause interactive editors to be spawned
for non-interactive tests.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-11 12:32:54 -07:00
Dennis Stosberg 0e26f7a1c3 Fix t8001-annotate and t8002-blame for ActiveState Perl
There seems to be at least one implementation of Perl which requires the
user to specify an extension for backup files.

Reported by Alex Riesen.

Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-19 18:43:20 -07:00
Dennis Stosberg 476a4dfc05 Make t8001-annotate and t8002-blame more portable
These two tests assume that "sed" will not modify the final line of a
stream if it does not end with a newline character.  The assumption is
not true at least for FreeBSD and Solaris 9.  FreeBSD's "sed" appends
a newline character; "sed" in Solaris 9 even removes the incomplete
final line.  This patch makes the test use perl instead.

Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18 13:58:20 -07:00
Mark Wooding 8c3222079a annotate-tests: override VISUAL when running tests.
The tests hang for me waiting for Emacs with its output directed
somewhere strage, because I hedged my bets and set both EDITOR and
VISUAL to run Emacs.

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-12 11:50:23 -08:00
Junio C Hamano 1242642c46 annotate-blame: tests incomplete lines.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-06 00:41:17 -08:00
Junio C Hamano ce5b6e7111 annotate-blame test: add evil merge.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-05 22:37:15 -08:00
Junio C Hamano 92a903acfd annotate/blame tests updates.
This rewrites the result check code a bit.  The earlier one
using awk was splitting columns at any whitespace, which
confused lines attributed incorrectly to the merge made by the
default author "A U Thor <author@example.com>" with lines
attributed to author "A".

The latest test by Ryan to add the "starting from older commit"
test is also included, with another older commit test.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-05 22:09:15 -08:00
Fredrik Kuivinen 8752d11d60 git-blame: Use the same tests for git-blame as for git-annotate
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-05 16:02:44 -08:00