Re: range-diff should suppress context-only changes?

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

 



Jeff King <peff@xxxxxxxx> writes:

> On Thu, Nov 05, 2020 at 12:22:32AM +0000, Elijah Newren via GitGitGadget wrote:
>
>> Range-diff vs v3:
>> [...]
>>   7:  42633b8d03 !  7:  5e8004c728 strmap: add more utility functions
>>      @@ strmap.h: void *strmap_get(struct strmap *map, const char *str);
>>       + * iterate through @map using @iter, @var is a pointer to a type strmap_entry
>>       + */
>>       +#define strmap_for_each_entry(mystrmap, iter, var)	\
>>      -+	for (var = hashmap_iter_first_entry_offset(&(mystrmap)->map, iter, 0); \
>>      -+		var; \
>>      -+		var = hashmap_iter_next_entry_offset(iter, 0))
>>      ++	hashmap_for_each_entry(&(mystrmap)->map, iter, var, ent)
>>       +
>>        #endif /* STRMAP_H */
>>   8:  ea942eb803 =  8:  fd96e9fc8d strmap: enable faster clearing and reusing of strmaps
>>   9:  c1d2172171 !  9:  f499934f54 strmap: add functions facilitating use as a string->int map
>> [...]
>>       @@ strmap.h: static inline int strmap_empty(struct strmap *map)
>>      - 		var; \
>>      - 		var = hashmap_iter_next_entry_offset(iter, 0))
>>      + #define strmap_for_each_entry(mystrmap, iter, var)	\
>>      + 	hashmap_for_each_entry(&(mystrmap)->map, iter, var, ent)
>>        
>>       +
>>       +/*
>>      @@ strmap.h: static inline int strmap_empty(struct strmap *map)
>
> Definitely not a problem with your patches, but I noticed this curiosity
> in the range-diff. Patch 7 changes the definition of the macro, but it
> gets mentioned again in patch 9, even though the code wasn't touched.
> The issue is that it the change from 7 ends up in the context of 9; the
> actual modification in patch 9 is in those final couple lines touching a
> comment (and they didn't change at all between the two versions).
>
> I wonder if it would be reasonable to suppress range-diff hunks in which
> all of the changed lines are context lines.

Sounds like a reasonable thing to do.  As we know the shape of what
is compared in the outer diff we should be able to accurately notice
where hunk boundaries are and a hunk whose change is only on context
lines.




[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