Re: [PATCH v2] git-diff: Output a warning about stale files in the index

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

 



Steven Grimm <koreth@xxxxxxxxxxxxx> writes:

> Signed-off-by: Steven Grimm <koreth@xxxxxxxxxxxxx>
> ---
> 	Modified as suggested by Junio.

Okay.

Assuming that other people are happy with this version (I have
to warn you that I haven't even attempted to apply this patch,
let alone compiling yet), I'd prefer to keep our combined
thought process in the commit log, so that we do not have to
rehash this later, over and over again.

Something along the following lines, perhaps...?

  After starting to edit a working tree file but later when your
  edit ends up identical to the original (this can also happen
  when you ran a wholesale regexp replace with something like
  "perl -i" that does not touch many of the paths), "git diff"
  between the index and the working tree outputs many "empty"
  diffs that show "diff --git" header and nothing else, because
  these paths are stat dirty.  While it was _a_ way to warn the
  user that the earlier action of the user made the index
  ineffective as an optimization mechanism, it was felt too loud
  for the purpose of warning even to experienced users, and also
  resulted in confusing people new to git.

  This replaces the "empty" diffs with a single warning message
  at the end.  When you see such a message, you know you did
  something suboptimal to your index; you can optimize the index
  again by running "git-update-index --refresh".

  The change affects only "git diff" that outputs patch text,
  because that is where the annoyance of too many "empty" diff
  is most strongly felt, and because the warning message can be
  safely ignored by downstream tools without getting mistaken as
  part of the patch.  For the low-level "git diff-files", the
  traditional behaviour is retained.

-
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