Creating Patches

Valdis.Kletnieks at vt.edu Valdis.Kletnieks at vt.edu
Tue Jun 3 12:55:51 EDT 2014


On Tue, 03 Jun 2014 22:15:21 +0530, me storage said:

> diff --git a/a.txt b/a.txt
> index 76e499a..c341c1c 100644
> --- a/a.txt
> +++ b/a.txt
> @@ -1,5 +1,5 @@
>  this
>  is
>  a
> -simple
> +slightly more complex file
>  file.
>
>
> My doubt is how to create patch file which contains the modifications only
> i.e lines with "+" only why because for example initially if a file
> contains 1000 rows.

It's showing the first 3 lines and the last line because of "context" - when
the patch is finally applied, the change may not apply at line 4, due to *other*
patches having added/deleted lines.  Usually git will display 3 lines either
side of the changed line.

Go ahead, create a 25 line patch, and change line 15, and see what the diff
shows then.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140603/02bba6d7/attachment.bin 


More information about the Kernelnewbies mailing list