bug-standards
[Top][All Lists]
Advanced

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

Re: Criteria for Acceptable Git to ChangeLog


From: John Darrington
Subject: Re: Criteria for Acceptable Git to ChangeLog
Date: Thu, 17 May 2018 16:44:38 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

I did a few experiments and it seems to me, that GNU diff's -p option
already does what you want.  Can you check the following example to 
see if it does what you require (the entities are in the lines marked
with ************** at the end of this mail).

Example: File old.c:

struct this
{
  int x;
  long y;
  short z;
};


union that
{
  char a;
  unsigned char b;
  signed char c;
};


static struct this foo;

int
main (int argc, char **argv)
{
  /* A comment */
  /* Another comment */
  return 0;
}

And File new.c:

struct this
{
  int x;
  long y;
  short z;

  char n;
};


union that
{
  char a;
  unsigned char b;
  signed char c;
  void *ppp;
};


static struct this foo;

int
main (int argc, char **argv)
{
  /* A comment */
  /* Another comment */
  int xx;
  return 0;
}

When compared using diff -p old.c new.c gives:


*** old.c       Thu May 17 16:39:13 2018
--- new.c       Thu May 17 16:39:34 2018
*************** struct this
*** 3,8 ****
--- 3,10 ----
    int x;
    long y;
    short z;
+ 
+   char n;
  };
  
  
*************** union that
*** 11,16 ****
--- 13,19 ----
    char a;
    unsigned char b;
    signed char c;
+   void *ppp;
  };
  
  
*************** main (int argc, char **argv)
*** 21,25 ****
--- 24,29 ----
  {
    /* A comment */
    /* Another comment */
+   int xx;
    return 0;
  }

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]