git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: git@vger.kernel.org
Cc: Johannes Sixt <j.sixt@viscovery.net>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Paolo Bonzini <bonzini@gnu.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: [PATCH] t4202-log.sh: Test git log --no-walk sort order
Date: Fri, 17 Jul 2009 16:28:06 +0200	[thread overview]
Message-ID: <1247840886-14795-1-git-send-email-git@drmicha.warpmail.net> (raw)
In-Reply-To: <alpine.DEB.1.00.0907141612350.4553@intel-tinevez-2-302>

'git log --no-walk' sorts commits by commit time whereas 'git show' does
not (it leaves them as given on the command line). Document this by two
tests so that we never forget why ba1d450 (Tentative built-in "git
show", 2006-04-15) introduced it and 8e64006 (Teach revision machinery
about --no-walk, 2007-07-24) exposed it as an option argument.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
 t/t4202-log.sh |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

v3: For completeness' sake, use git show -s.

diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index aad3894..48e0088 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -149,6 +149,26 @@ test_expect_success 'git log --follow' '
 
 '
 
+cat > expect << EOF
+804a787 sixth
+394ef78 fifth
+5d31159 fourth
+EOF
+test_expect_success 'git log --no-walk <commits> sorts by commit time' '
+	git log --no-walk --oneline 5d31159 804a787 394ef78 > actual &&
+	test_cmp expect actual
+'
+
+cat > expect << EOF
+5d31159 fourth
+804a787 sixth
+394ef78 fifth
+EOF
+test_expect_success 'git show <commits> leaves list of commits as given' '
+	git show --oneline -s 5d31159 804a787 394ef78 > actual &&
+	test_cmp expect actual
+'
+
 test_expect_success 'setup case sensitivity tests' '
 	echo case >one &&
 	test_tick &&
-- 
1.6.3.3.483.g4f5e

  parent reply	other threads:[~2009-07-17 14:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-13 21:41 Make 'git show' more useful Linus Torvalds
2009-07-13 22:11 ` Junio C Hamano
2009-07-13 23:43   ` [PATCH] " Paolo Bonzini
2009-07-14  0:00     ` Linus Torvalds
2009-07-14  1:25       ` Johannes Schindelin
2009-07-14  1:47         ` Linus Torvalds
2009-07-14  6:25         ` Paolo Bonzini
2009-07-14 10:44           ` Johannes Schindelin
2009-07-14 12:08             ` [PATCH] t4202-log.sh: Test git log --no-walk sort order Michael J Gruber
2009-07-14 12:21               ` Johannes Sixt
2009-07-14 12:38                 ` Michael J Gruber
2009-07-14 12:45                 ` [PATCHv2] " Michael J Gruber
2009-07-14 14:13                   ` Johannes Schindelin
2009-07-14 14:28                     ` Michael J Gruber
2009-07-17 14:28                     ` Michael J Gruber [this message]
2009-07-17 14:53                       ` [PATCH] " Johannes Schindelin
2009-07-13 23:42 ` Make 'git show' more useful Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1247840886-14795-1-git-send-email-git@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=bonzini@gnu.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j.sixt@viscovery.net \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).