Re: [PATCH] date: remove approxidate_relative()

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

 



On Mon, Apr 10, 2023 at 09:20:49AM -0700, Junio C Hamano wrote:

> Perhaps
> 
> 	$ git -c format-patch.date.c.context=16 format-patch -1
> 
> would be a workable idea?  I do not think it makes any sense to say
> "when taking a diff for this path, always use 16 lines of context"
> so it should not be stored in a file to be used every time, like
> 
> 	[format-patch "date.c"] context = 16
> 
> and it makes even less sense to say that all project participants
> should use this context, always, so making it an attribute would be
> even less appropriate.
> 
> But this was the easiest way to prototype ;-)  If this turns out to
> be useful, the real version should probably be done by:

Cute. It feels like this only goes half-way, though. You really want
per-hunk configurable context. This particular patch was just lucky that
there was only one hunk in the date.c file.

I'm not sure of the least-confusing way to address a single hunk, though
(by line number is one option, by hunk-number within the patch is
another). I suspect the best workflow for a user would be to
interactively say "show me more context for this hunk". Some viewers
have support for that (e.g., GitHub's web view of a diff). But handling
that for a one-shot CLI program is tricky, not to mention then feeding
it back to format-patch to generate the output you want to send. :)

-Peff



[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