<feed xmlns='http://www.w3.org/2005/Atom'>
<title>GitPython/git/test/fixtures/diff_initial, branch 2.0.1</title>
<subtitle>Forked from https://github.com/gitpython-developers/GitPython</subtitle>
<link rel='alternate' type='text/html' href='https://git.otimperi.dev/GitPython/'/>
<entry>
<title>Make diff patch parsing more reliable</title>
<updated>2016-04-19T19:45:18+00:00</updated>
<author>
<name>Vincent Driessen</name>
<email>me@nvie.com</email>
</author>
<published>2016-04-14T19:27:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.otimperi.dev/GitPython/commit/?id=e77128e5344ce7d84302facc08d17c3151037ec3'/>
<id>e77128e5344ce7d84302facc08d17c3151037ec3</id>
<content type='text'>
The a_path and b_path cannot reliably be read from the first diff line
as it's ambiguous.  From the git-diff manpage:

  &gt; The a/ and b/ filenames are the same unless rename/copy is involved.
  &gt; Especially, **even for a creation or a deletion**, /dev/null is not
  &gt; used in place of the a/ or b/ filenames.

This patch changes the a_path and b_path detection to read it from the
more reliable locations further down the diff headers.  Two use cases
are fixed by this:

  - As the man page snippet above states, for new/deleted files the a
    or b path will now be properly None.
  - File names with spaces in it are now properly parsed.

Working on this patch, I realized the --- and +++ lines really belong to
the diff header, not the diff contents.  This means that when parsing
the patch format, the --- and +++ will now be swallowed, and not end up
anymore as part of the diff contents.  The diff contents now always
start with an @@ line.

This may be a breaking change for some users that rely on this
behaviour.  However, those users could now access that information more
reliably via the normal Diff properties a_path and b_path now.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The a_path and b_path cannot reliably be read from the first diff line
as it's ambiguous.  From the git-diff manpage:

  &gt; The a/ and b/ filenames are the same unless rename/copy is involved.
  &gt; Especially, **even for a creation or a deletion**, /dev/null is not
  &gt; used in place of the a/ or b/ filenames.

This patch changes the a_path and b_path detection to read it from the
more reliable locations further down the diff headers.  Two use cases
are fixed by this:

  - As the man page snippet above states, for new/deleted files the a
    or b path will now be properly None.
  - File names with spaces in it are now properly parsed.

Working on this patch, I realized the --- and +++ lines really belong to
the diff header, not the diff contents.  This means that when parsing
the patch format, the --- and +++ will now be swallowed, and not end up
anymore as part of the diff contents.  The diff contents now always
start with an @@ line.

This may be a breaking change for some users that rely on this
behaviour.  However, those users could now access that information more
reliably via the normal Diff properties a_path and b_path now.
</pre>
</div>
</content>
</entry>
<entry>
<title>Support "root" as a special value in .diff() calls</title>
<updated>2016-04-14T10:39:37+00:00</updated>
<author>
<name>Vincent Driessen</name>
<email>me@nvie.com</email>
</author>
<published>2016-04-12T13:55:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.otimperi.dev/GitPython/commit/?id=5de21c7fa2bdd5cd50c4f62ba848af54589167d0'/>
<id>5de21c7fa2bdd5cd50c4f62ba848af54589167d0</id>
<content type='text'>
This enabled getting diff patches for root commits.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This enabled getting diff patches for root commits.
</pre>
</div>
</content>
</entry>
</feed>
