Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Torsten Bögershausen" <tboegi@web.de>
Cc: git@vger.kernel.org, philipoakley@iee.org
Subject: Re: [PATCH] Add ls-files --eol-staged, --eol-worktree
Date: Sun, 18 Oct 2015 23:32:14 -0700	[thread overview]
Message-ID: <xmqqvba39xn5.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <56247E3F.40804@web.de> ("Torsten Bögershausen"'s message of "Mon, 19 Oct 2015 07:23:11 +0200")

Torsten Bögershausen <tboegi@web.de> writes:

> I like this idea:
>
> binary
> text
> crlf
> mixed
> lf

If you really like it, it would mean that my attempt to use Socratic
method to enlighten you why the above is not a good idea failed X-<.

> ----------------
> $ git ls-files --eol-staged -s
>  [snip]
>  100644 981f810e80008d878d6a5af1331c89dc093c5927 0       txt-lf worktree.c

Does it even make sense to give --eol-worktree in this case?

> My understanding is that the eol options work togther with the existing option,
> as long as it makes sense (but see below)
>
> "git check-attr" will even report attributes for a file, that doesn't even exist.

Both "ls-files -o/-i" talk about untracked paths, so that is not a
very useful and valid objection, is it?

> "git ls-files is a command which by default operates on the staged
> area, unless I mis-understand it.

It is even worse than that.  It is true that "ls-files [-s]" is
about "--cached" and there is no equivalent to show the working tree
version.  But "-t", "-d", etc. are not about the state in the index
nor the state in the working tree.  They are about the relationship
between these two states.

What the new operation wants to do, if I understand correctly, is
either check the blob contents in the working tree or in the index,
which is not a good fit with what the rest of "ls-files" does for
exactly that reason.  The inability to mix -s with --eol-worktree
is another natural consequence of this.

> I was thinking about adding "git check-eol", but didn't want to
> introduce just another command,

Between adding a new command that does one thing well and whose user
interaction is coherent with the rest of the system, and adding a
new operation mode to an existing command and makes the user
interaction of that existing command more incoherent by introducing
two variants --foo and --foo-worktree when there is no existing
option that has similar variant pair, I'd say we prefer to see a new
command.

The -z output, and --stdin input are what we would want to have for
the new command, but I do not think we want it to know -o, -x or -X.
You would instead pipe output from ls-files with these options to
the new command run with the --stdin option.

      reply	other threads:[~2015-10-19  6:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-17 20:18 [PATCH] Add ls-files --eol-staged, --eol-worktree Torsten Bögershausen
2015-10-18  1:10 ` Eric Sunshine
2015-10-18 10:03 ` Philip Oakley
2015-10-18 17:35 ` Junio C Hamano
2015-10-18 18:32   ` Junio C Hamano
2015-10-18 19:00 ` Junio C Hamano
2015-10-19  5:23   ` Torsten Bögershausen
2015-10-19  6:32     ` Junio C Hamano [this message]

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=xmqqvba39xn5.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=philipoakley@iee.org \
    --cc=tboegi@web.de \
    /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