Re: [PATCH] Improve errors from 'git diff --no-index'.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio --

This fundamentally all started as me confusing myself, and the patch
was the result of me scratching that itch.  As such, I'm perfectly
willing to drop it, but I did want to address a few last things:

On Mon, May 23, 2011 at 1:22 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:

>> $ # with my patch:
>> $ ../git/git-diff /tmp/{foo,bar}
>> warning: neither '/tmp/foo' nor '/tmp/bar' are tracked, forcing --no-index
>
> I actually consider this a regression. We are giving an output that the
> user wanted to see, and I do not see a reason why we need to warn.

No, we're not: the user did *not* ask for a no-index diff, but we're
giving them one anyway. That warrants a warn (or other message; if
there's a less-severe version of "warn", then that's fine) to tell
them that the software is trying to "do what you mean".

Please also keep in mind that you live and breathe git, and have done
so for years (and I'm very thankful for that!).  But not everyone has
the git mindset all the time; adding an extra message or two doesn't
seem like too much pain to help novices and dilettantes.

> But that consistency goes totally against what the users would expect.
> This inconsistency is not a fault of either the definition of "git diff"
> nor the user's expectation. They are fundamentally different and the root
> cause of it is that we support --no-index diff between randomly chosen two
> files.

Maybe we *should* drop the feature: I would have been *happier* had
the error message from my initial attempt been simply: "not in a git
repo, can't use git diff". (Since that was, fundamentally, the mistake
I made.)

Maybe install "diff-git" or even "gdiff" (although maybe that's used
by gnu diff on non-gnu platforms, dunno).

But I maintain that the current combination of options, assumptions,
and error output are insufficient, and I still feel that my patch(es)
improve that matter.  *shrug*  Your call, of course.

Best regards,
Tony
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]