git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Stefan Beller <stefanbeller@googlemail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, jrnieder@gmail.com, trast@student.ethz.ch
Subject: Re: [PATCH 0/2] git diff -q option removal
Date: Wed, 17 Jul 2013 22:05:07 +0200	[thread overview]
Message-ID: <51E6F8F3.6020404@googlemail.com> (raw)
In-Reply-To: <7vvc496ruf.fsf@alter.siamese.dyndns.org>

[-- Attachment #1: Type: text/plain, Size: 2956 bytes --]

On 07/17/2013 07:04 PM, Junio C Hamano wrote:

> Builtins link all sorts of stuff from outside, e.g. diff.c and
> diffcore-*.c at the toplevel.  I do not see diff_no_index.c is any
> different, so I am probably not understanding your question.

Thanks for the explanation. I am not yet very used to gits code structure. So I sometimes think of 'how would I structure things', so I
was confused of things in builtin using some parts outside of it.
Maybe that folder raised to much expectations for me to be 'the real'
core, whereas the files outside, i.e. those files in the top level
directory, are just there for other things or scripts.
This understanding of the structure seems obviously wrong now.

Thanks for clarification.

> 
> Hmm, do you really get that error message?  I think you would get
> 
>     fatal: ambiguous argument 'no_file': unknown revision or path not in the working tree.
> 
>> 	echo $?
>> 	1

Ok here we go (using current origin/master 9c3c367):

	cd $(mktemp -d)
	echo "test" > actual_file
	git diff actual_file no_file
	# error: Could not access 'no_file'
	echo $?
	1
	
	## I get the same message as well, if I'm using -- or not.
	## also the -q doesn't make a change

	git init 
	git diff -q -- actual_file no_file
	echo $?
	# 0
	git diff  -- actual_file no_file
	echo $?
	# 0
	git diff  actual_file no_file
	# fatal: no_file: no such path in the working tree.
	# Use 'git <command> -- <path>...' to specify paths that do not exist locally.
	echo $?
	# 128
	git diff -q  actual_file no_file
	# fatal: no_file: no such path in the working tree.
	# Use 'git <command> -- <path>...' to specify paths that do not exist locally.
	echo $?
	128

So apparently git diff behaves differently if not in a repo, which is what I tested.

> 
> The command line parsing infrastructure has changed vastly since
> "show-diff" days (see below for a history lesson);

A very interesting read, much appreciated. :)

> 
> If we wanted to make "-q" follow the spirit of its original addition
> to "show-diff" again, we could internally add a diff-filter when the
> "-q" option is parsed.
> 

I'm rather new to the project, so my opinion may not have much weight,
I'll state it anyway:
Keeping backwards compatibility is really hard, because you need the 
knowledge of such history lessons as read above, to understand what should
happen, like having an intuitive feeling about such parameters. Hence
maintaining/evolving the project will become harder and harder 
(specially for newcomers). So having one and only one way to achieve the desired
output, which fits into the greater structure as it's the case with --diff-filter
is easier to remember for both the user and developers.

Hence I think keeping the -q option would only make sense for the plumber 
layer, because there the explicit promise was given to not change stuff
every other release. 

Stefan




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

  parent reply	other threads:[~2013-07-17 20:05 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-14 21:35 [PATCH 1/4] daemon.c:handle: Remove unneeded check for null pointer Stefan Beller
2013-07-14 21:35 ` [PATCH 2/4] commit: Fix a memory leak in determine_author_info Stefan Beller
2013-07-14 21:49   ` Jonathan Nieder
2013-07-14 21:35 ` [PATCH 3/4] diff-no-index: Remove unused variable Stefan Beller
2013-07-14 22:07   ` Jonathan Nieder
2013-07-16 10:28     ` [PATCH 0/2] git diff -q option removal Stefan Beller
2013-07-16 10:28       ` [PATCH 1/2] diff --no-index: remove nonfunctional "-q" handling Stefan Beller
2013-07-16 10:28       ` [PATCH 2/2] diff: Remove -q to stay silent on missing files Stefan Beller
2013-07-17 17:04       ` [PATCH 0/2] git diff -q option removal Junio C Hamano
2013-07-17 18:06         ` Junio C Hamano
2013-07-17 20:05         ` Stefan Beller [this message]
2013-07-18  0:30         ` [PATCH 0/6] Deprecating "diff-files -q" Junio C Hamano
2013-07-18  0:30           ` [PATCH 1/6] diff: pass the whole diff_options to diffcore_apply_filter() Junio C Hamano
2013-07-18  0:30           ` [PATCH 2/6] diff: factor out match_filter() Junio C Hamano
2013-07-18  0:30           ` [PATCH 3/6] diff: preparse --diff-filter string argument Junio C Hamano
2013-07-18  0:30           ` [PATCH 4/6] diff: reject unknown change class given to --diff-filter Junio C Hamano
2013-07-18  0:30           ` [PATCH 5/6] diff: allow lowercase letter to specify what change class to exclude Junio C Hamano
2013-07-18  0:30           ` [PATCH 6/6] diff: deprecate -q option to diff-files Junio C Hamano
2013-07-19  3:20             ` [PATCH 7/6] diff: remove "diff-files -q" at Git 2.0 version boundary Junio C Hamano
2013-07-19  3:31             ` [PATCH 6/6] diff: deprecate -q option to diff-files Jonathan Nieder
2013-07-19  7:24               ` Junio C Hamano
2013-07-19 21:01                 ` Jonathan Nieder
2013-07-14 21:35 ` [PATCH 4/4] diff.c: Do not initialize a variable, which gets reassigned anyway Stefan Beller
2013-07-14 22:18   ` Jonathan Nieder
2013-07-14 21:48 ` [PATCH 1/4] daemon.c:handle: Remove unneeded check for null pointer Jonathan Nieder

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=51E6F8F3.6020404@googlemail.com \
    --to=stefanbeller@googlemail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=trast@student.ethz.ch \
    /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.
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).