git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Deprecating git diff ..; dealing with other ranges
@ 2019-03-11  9:37 Denton Liu
  2019-03-11 13:19 ` Johannes Schindelin
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Denton Liu @ 2019-03-11  9:37 UTC (permalink / raw)
  To: Git Mailing List
  Cc: Junio C Hamano, Philip Oakley, Elijah Newren, Viresh Kumar,
	vincent.guittot, Johannes Schindelin

Hello all,

I was in the process of deprecating `git diff <commit>..<commit>` as
discussed here[1]. However, I ran into a weird case that I'm not sure
how to deal with.

In t3430-rebase-merges.sh:382, we have the following test case which
invokes git diff:

	test_expect_success 'with --autosquash and --exec' '
		git checkout -b with-exec H &&
		echo Booh >B.t &&
		test_tick &&
		git commit --fixup B B.t &&
		write_script show.sh <<-\EOF &&
		subject="$(git show -s --format=%s HEAD)"
=>		content="$(git diff HEAD^! | tail -n 1)"
		echo "$subject: $content"
		EOF
		test_tick &&
		git rebase -ir --autosquash --exec ./show.sh A >actual &&
		grep "B: +Booh" actual &&
		grep "E: +Booh" actual &&
		grep "G: +G" actual
	'

It gets caught in my attempt to only deprecate ..'s. Technically, it's
undocumented behaviour and it only happens to work because git-diff
accept ranges but it doesn't operate in an intuitive way.

I was just wondering what we should do about this case? Should we
deprecate all invocations of `git diff <range>` except for the special
case of `git diff <commit>...<commit>`, or should we _only_ deprecate
`git diff <commit>..<commit>` and allow all other forms of ranges, even
though it was undocumented behaviour?

Thanks,

Denton

[1]: https://public-inbox.org/git/xmqqmumy6mxe.fsf@gitster-ct.c.googlers.com/

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-03-18 18:52 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-11  9:37 Deprecating git diff ..; dealing with other ranges Denton Liu
2019-03-11 13:19 ` Johannes Schindelin
2019-03-11 15:34 ` Elijah Newren
2019-03-12  7:17 ` Junio C Hamano
2019-03-12 17:24   ` Andreas Schwab
2019-03-12 21:01     ` Ævar Arnfjörð Bjarmason
2019-03-13  7:01       ` Johannes Sixt
2019-03-18 17:07       ` Elijah Newren
2019-03-18 17:11         ` Michal Suchánek
2019-03-18 18:51           ` Elijah Newren
2019-03-18 17:59         ` Ævar Arnfjörð Bjarmason
2019-03-13  1:20     ` Duy Nguyen
2019-03-13 18:12       ` Andreas Schwab
2019-03-12  7:22 ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).