is it possible to add a comment to a diff file (unified)?

前端 未结 3 1243
一向
一向 2020-12-29 19:15

I wonder if it\'s possible to add a certain amount of unparsed content to a diff file (unified) that is ignored as a comment.

One good use of this would be having g

3条回答
  •  庸人自扰
    2020-12-29 20:11

    You can use # instead of - or + in the diff file for inline comments (recognizable by GNU patch), or add a comment at the begining mentioned by @JakubJirutka

     This may be some useful description of this patch that
     will be ignored by the diff/patch utility.
     --- a/foo  2002-02-21 23:30:39.942229878 -0800
     +++ b/foo  2002-02-21 23:30:50.442260588 -0800
     @@ -1,7 +1,6 @@
     # comments on the deletion of the two lines
     -The Way that can be told of is not the eternal Way;
     -The name that can be named is not the eternal name.
      The Nameless is the origin of Heaven and Earth;
     -The Named is the mother of all things.
     +The named is the mother of all things.
     +
      Therefore let there always be non-being,
        so we may see their subtlety,
      And let there always be being,
    

提交回复
热议问题