Re: [RFC/PATCH] shortstatus v1

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

 



On Tue, Feb 10, 2009 at 12:29:40PM +0100, Michael J Gruber wrote:

> >   3. What advantage does this have over just doing:
> > 
> >        (git diff --name-status;
> >         git diff --cached --name-status) | sort -k2
> 
> That is fine, except that it can't list untracked files.

Well, neither does this patch:

  $ echo content >tracked &&
  > echo content >untracked &&
  > git add tracked &&
  > git shortstatus
  A           tracked

but you could easily include that:

  (git diff --name-status;
   git diff --cached --name-status;
   git ls-files --exclude-standard -o | sed 's/^/? /') | sort -k2

which is really more or less what the wt-status code does.

Note that I am not _against_ a convenient command for doing this. But I
have to wonder why such a large patch is necessary when I can do it in
three lines. I don't mind the C version being a little longer, but I
wonder what advantage there is in using wt_status for this.

> Right now, "git status" is basically "git commit --dry-run", which may
> or may not be good, but certainly is not what people coming from other
> vcs expect. I would suggest having "git commit -n" replace "git status"
> if I hadn't done so already or if I dared to (I can't remember ;) ).

I would much prefer that, if it had been done that way from the
beginning. But I think we are stuck with "git status" due to hysterical
raisins.

> "git ls-files" may do but has a different set of mode characters. I
> think that sums up what preceeded Junio's patch from October.

But you only need to use it here to get the untracked files, so it
doesn't matter what it says about modified files.

The big downside with the snippet I posted above is that it runs three
separate commands that go through the index. In theory, you could do it
in one pass. But wt-status _doesn't_ do that, since the diff
infrastructure isn't there (a long time ago, Junio had an experimental
parallel diff walker patch, but it never made it out of next).

-Peff
--
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]

  Powered by Linux