Hg diffs are not minimal

Chuck Ebbert 76306.1226 at compuserve.com
Wed Aug 10 18:20:31 CDT 2005


  I used 'hg diff' to generate a diff between linux 2.6.13-rc5 and -rc6.
There were 32 extra inserts and 32 extra deletes vs. a patch generated by
diffing the source trees.  Looks like mercurial patches sometimes add and
remove the exact same line.


  Here is an example... first the hg-generated diff:

diff -r c37d609f9ba3 -r 41a2c32624ac net/ipv4/tcp_output.c
--- a/net/ipv4/tcp_output.c     Tue Aug  2 04:45:48 2005
+++ b/net/ipv4/tcp_output.c     Sun Aug  7 18:18:56 2005
@@ -403,11 +403,9 @@
                sk->sk_send_head = skb;
 }

-static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb)
-{
-       struct tcp_sock *tp = tcp_sk(sk);
-
-       if (skb->len <= tp->mss_cache ||
+static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb, unsigned int mss_now)
+{
+       if (skb->len <= mss_now ||
            !(sk->sk_route_caps & NETIF_F_TSO)) {
                /* Avoid the costly divide in the normal
                 * non-TSO case.


  ...here is the one from GNU diff:

diff -urN 2.6.13-rc5/net/ipv4/tcp_output.c 2.6.13-rc6/net/ipv4/tcp_output.c
--- 2.6.13-rc5/net/ipv4/tcp_output.c    2005-07-31 05:29:20.000000000 -0400
+++ 2.6.13-rc6/net/ipv4/tcp_output.c    2005-08-08 12:10:19.000000000 -0400
@@ -403,11 +403,9 @@
                sk->sk_send_head = skb;
 }

-static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb)
+static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb, unsigned int mss_now)
 {
-       struct tcp_sock *tp = tcp_sk(sk);
-
-       if (skb->len <= tp->mss_cache ||
+       if (skb->len <= mss_now ||
            !(sk->sk_route_caps & NETIF_F_TSO)) {
                /* Avoid the costly divide in the normal
                 * non-TSO case.

__
Chuck


More information about the Mercurial mailing list