<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/gitpython.git/git/test/fixtures, branch no_devnull_open</title>
<subtitle>github.com: gitpython-developers/GitPython.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/gitpython.git/'/>
<entry>
<title>io, #519: ALL open() --&gt; with open()</title>
<updated>2016-10-01T16:25:57+00:00</updated>
<author>
<name>Kostis Anagnostopoulos</name>
<email>ankostis@gmail.com</email>
</author>
<published>2016-10-01T16:20:13+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/gitpython.git/commit/?id=9a521681ff8614beb8e2c566cf3c475baca22169'/>
<id>9a521681ff8614beb8e2c566cf3c475baca22169</id>
<content type='text'>
+ Some cases had restructuring of code.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
+ Some cases had restructuring of code.</pre>
</div>
</content>
</entry>
<entry>
<title>fix(diff): use explicit change-type if possible</title>
<updated>2016-07-23T14:45:40+00:00</updated>
<author>
<name>Sebastian Thiel</name>
<email>byronimo@gmail.com</email>
</author>
<published>2016-07-23T14:38:59+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/gitpython.git/commit/?id=4006c4347788a078051dffd6b197bb0f19d50b86'/>
<id>4006c4347788a078051dffd6b197bb0f19d50b86</id>
<content type='text'>
That way, we do not have to figure the change type out by
examining the diff object.

It's implemented in a way that should yield more desireable results
as we keep the change-type that git is providing us with.

Fixes #493
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
That way, we do not have to figure the change type out by
examining the diff object.

It's implemented in a way that should yield more desireable results
as we keep the change-type that git is providing us with.

Fixes #493
</pre>
</div>
</content>
</entry>
<entry>
<title>Don't choke on (legitimately) invalidly encoded Unicode paths</title>
<updated>2016-06-06T10:16:11+00:00</updated>
<author>
<name>Vincent Driessen</name>
<email>me@nvie.com</email>
</author>
<published>2016-06-06T10:13:37+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/gitpython.git/commit/?id=200d3c6cb436097eaee7c951a0c9921bfcb75c7f'/>
<id>200d3c6cb436097eaee7c951a0c9921bfcb75c7f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #456 from gitpython-developers/fix-for-invalid-data-in-commits</title>
<updated>2016-05-30T16:58:30+00:00</updated>
<author>
<name>Sebastian Thiel</name>
<email>byronimo@gmail.com</email>
</author>
<published>2016-05-30T16:58:30+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/gitpython.git/commit/?id=79fdaf349fa8ad3524f67f1ef86c38ecfc317585'/>
<id>79fdaf349fa8ad3524f67f1ef86c38ecfc317585</id>
<content type='text'>
Add test case as example of Git commit with invalid data</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add test case as example of Git commit with invalid data</pre>
</div>
</content>
</entry>
<entry>
<title>Add test case as example of Git commit with invalid data</title>
<updated>2016-05-30T14:32:26+00:00</updated>
<author>
<name>Vincent Driessen</name>
<email>me@nvie.com</email>
</author>
<published>2016-05-30T14:20:22+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/gitpython.git/commit/?id=0eafe201905d85be767c24106eb1ab12efd3ee22'/>
<id>0eafe201905d85be767c24106eb1ab12efd3ee22</id>
<content type='text'>
This is a real commit from the microjs.com open source project, see
https://github.com/madrobby/microjs.com/commit/7e8457c17850d0991763941213dcb403d80f39f8,
which is declared to be encoded in UTF-8, but contains invalid bytes.

This makes GitPython choke on it while decoding.  Rather than choking,
this should instead accept the error and replace the invalid bytes by
the �  (\x80) char.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a real commit from the microjs.com open source project, see
https://github.com/madrobby/microjs.com/commit/7e8457c17850d0991763941213dcb403d80f39f8,
which is declared to be encoded in UTF-8, but contains invalid bytes.

This makes GitPython choke on it while decoding.  Rather than choking,
this should instead accept the error and replace the invalid bytes by
the �  (\x80) char.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix bug in diff parser output</title>
<updated>2016-05-30T13:44:46+00:00</updated>
<author>
<name>Vincent Driessen</name>
<email>me@nvie.com</email>
</author>
<published>2016-05-30T13:26:23+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/gitpython.git/commit/?id=1faf84f8eb760b003ad2be81432443bf443b82e6'/>
<id>1faf84f8eb760b003ad2be81432443bf443b82e6</id>
<content type='text'>
The diff --patch parser was missing some edge case where Git would
encode non-ASCII chars in path names as octals, but these weren't
decoded properly.

    \360\237\222\251.txt

Decoded via utf-8, that will return:

    💩.txt
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The diff --patch parser was missing some edge case where Git would
encode non-ASCII chars in path names as octals, but these weren't
decoded properly.

    \360\237\222\251.txt

Decoded via utf-8, that will return:

    💩.txt
</pre>
</div>
</content>
</entry>
<entry>
<title>Split lines by new line characters</title>
<updated>2016-05-24T15:19:14+00:00</updated>
<author>
<name>Jonathan Chu</name>
<email>jonathan.chu@me.com</email>
</author>
<published>2016-05-24T15:19:14+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/gitpython.git/commit/?id=73ab28744df3fc292a71c3099ff1f3a20471f188'/>
<id>73ab28744df3fc292a71c3099ff1f3a20471f188</id>
<content type='text'>
Opt to split lines by the new line character instead of letting
`splitlines()` do this. This helps catch the issue when there are
special characters in the line, particular the commit summary section.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Opt to split lines by the new line character instead of letting
`splitlines()` do this. This helps catch the issue when there are
special characters in the line, particular the commit summary section.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix diff patch parser for paths with unsafe chars</title>
<updated>2016-04-19T21:46:54+00:00</updated>
<author>
<name>Vincent Driessen</name>
<email>me@nvie.com</email>
</author>
<published>2016-04-19T21:41:01+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/gitpython.git/commit/?id=7fbc182e6d4636f67f44e5893dee3dcedfa90e04'/>
<id>7fbc182e6d4636f67f44e5893dee3dcedfa90e04</id>
<content type='text'>
This specifically covers the cases where unsafe chars occur in path
names, and git-diff -p will escape those.

From the git-diff-tree manpage:

&gt; 3. TAB, LF, double quote and backslash characters in pathnames are
&gt;    represented as \t, \n, \" and \\, respectively. If there is need
&gt;    for such substitution then the whole pathname is put in double
&gt;    quotes.

This patch checks whether or not this has happened and will unescape
those paths accordingly.

One thing to note here is that, depending on the position in the patch
format, those paths may be prefixed with an a/ or b/.  I've specifically
made sure to never interpret a path that actually starts with a/ or b/
incorrectly.

Example of that subtlety below.  Here, the actual file path is
"b/normal".  On the diff file that gets encoded as "b/b/normal".

     diff --git a/b/normal b/b/normal
     new file mode 100644
     index 0000000000000000000000000000000000000000..eaf5f7510320b6a327fb308379de2f94d8859a54
     --- /dev/null
     +++ b/b/normal
     @@ -0,0 +1 @@
     +dummy content

Here, we prefer the "---" and "+++" lines' values.  Note that these
paths start with a/ or b/.  The only exception is the value "/dev/null",
which is handled as a special case.

Suppose now the file gets moved "b/moved", the output of that diff would
then be this:

     diff --git a/b/normal b/b/moved
     similarity index 100%
     rename from b/normal
     rename to b/moved

We prefer the "rename" lines' values in this case (the "diff" line is
always a last resort).  Take note that those lines are not prefixed with
a/ or b/, but the ones in the "diff" line are (just like the ones in
"---" or "+++" lines).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This specifically covers the cases where unsafe chars occur in path
names, and git-diff -p will escape those.

From the git-diff-tree manpage:

&gt; 3. TAB, LF, double quote and backslash characters in pathnames are
&gt;    represented as \t, \n, \" and \\, respectively. If there is need
&gt;    for such substitution then the whole pathname is put in double
&gt;    quotes.

This patch checks whether or not this has happened and will unescape
those paths accordingly.

One thing to note here is that, depending on the position in the patch
format, those paths may be prefixed with an a/ or b/.  I've specifically
made sure to never interpret a path that actually starts with a/ or b/
incorrectly.

Example of that subtlety below.  Here, the actual file path is
"b/normal".  On the diff file that gets encoded as "b/b/normal".

     diff --git a/b/normal b/b/normal
     new file mode 100644
     index 0000000000000000000000000000000000000000..eaf5f7510320b6a327fb308379de2f94d8859a54
     --- /dev/null
     +++ b/b/normal
     @@ -0,0 +1 @@
     +dummy content

Here, we prefer the "---" and "+++" lines' values.  Note that these
paths start with a/ or b/.  The only exception is the value "/dev/null",
which is handled as a special case.

Suppose now the file gets moved "b/moved", the output of that diff would
then be this:

     diff --git a/b/normal b/b/moved
     similarity index 100%
     rename from b/normal
     rename to b/moved

We prefer the "rename" lines' values in this case (the "diff" line is
always a last resort).  Take note that those lines are not prefixed with
a/ or b/, but the ones in the "diff" line are (just like the ones in
"---" or "+++" lines).
</pre>
</div>
</content>
</entry>
<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='http://91.123.203.49/cgit/delta/python-packages/gitpython.git/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='http://91.123.203.49/cgit/delta/python-packages/gitpython.git/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>
