git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* range-diff should suppress context-only changes?
@ 2020-11-05 13:34 Jeff King
  2020-11-05 20:55 ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Jeff King @ 2020-11-05 13:34 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren

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.

-Peff

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-11-17 23:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-05 13:34 range-diff should suppress context-only changes? Jeff King
2020-11-05 20:55 ` Junio C Hamano
2020-11-17 21:35   ` Johannes Altmanninger
2020-11-17 21:35     ` [PATCH 1/3] range-diff: move " ## filename ##" headers to the first column Johannes Altmanninger
2020-11-17 21:35     ` [PATCH 2/3] range-diff: ignore context-only changes Johannes Altmanninger
2020-11-17 22:56       ` Eric Sunshine
2020-11-17 21:35     ` [PATCH 3/3] range-diff: only compute patch diff when patches are different Johannes Altmanninger

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).