Re: [PATCH] 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>
> ---
> 	This is based on (and includes) Junio's patch. This should
> 	hopefully address the "I want to know when my index is very
> 	stale" problem with both his original patch and mine.
>
> 	If we are running a pager, I output the warning to standard
> 	output so it doesn't get immediately scrolled off the screen by
> 	the paged diff output. Otherwise I output to standard error
> 	which is really the more appropriate place for the warning.
> 	Obviously that is no good if the user is running his own pager,
> 	but I'm not sure how to detect that and not cause problems for
> 	diffs that are piped into other programs.

Hmph.  One way to avoid causing problems for diffs that are
piped into other programs and still give the "index of sync"
warning is to emit "diff --git" line and no patch body fot
textual diffs, or 0{40} SHA-1 on the right hand side for --raw
format diffs.

Jokes aside...

For textual diffs, I think we can always spit out the warning
message at the beginning of at the end on the standard output
without harming any of the patch based toolchain.

So how about...

 - If and only if the output format asks for textual diff
   (DIFF_FORMAT_PATCH), we do this "stat-dirty-removal";
   otherwise we do not spend extra cycles and keep the current
   behaviour.

 - At the end of patch text, show "stat-dirty-removal" warning
   on stdout.



-
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