| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/ |
|
|
|
|
|
|
| |
Don't allow `, ` prefixes or suffixes in messages.
Fixes #438
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
Need spaces in Emacs style encoding comment
|
| |
| |
| |
| |
| | |
Although it's hard to see, PEP-0263 does have ws delimiting the 'coding' string.
This commit will fix the root cause of (at least) one bug: https://lists.fedoraproject.org/archives/list/eclipse-sig@lists.fedoraproject.org/thread/5XQ5JRHG6DPPMGRDU7TA2AO4EYS2H7AG/
|
|/
|
|
| |
Fixes #426
|
|
|
|
| |
Who would have thought we ever go 2.0 ;).
|
|\
| |
| | |
Add support for getting "aware" datetime info
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This adds 2 properties to commits. Their values are derived from the
existing data stored on them, but this makes them more conveniently
queryable:
- authored_datetime
- committed_datetime
These return "aware" datetimes, so they are effectively companions to
their raw timestamp equivalents, respectively `authored_date` and
`committed_date`.
These datetime instances are convenient structures since they show the
author-local commit date and their UTC offset.
|
| |
| |
| |
| | |
Specifically "string_escape" does not exist as an encoding anymore.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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:
> 3. TAB, LF, double quote and backslash characters in pathnames are
> represented as \t, \n, \" and \\, respectively. If there is need
> for such substitution then the whole pathname is put in double
> 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).
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some Git command line options are allowed to be repeated multiple times.
Examples of this are the -C flag which may occur more than once to
"strengthen" its effect, or the -L flag on Git blames, to select
multiple blocks of lines to blame.
$ git diff -C -C HEAD~1 HEAD
$ git blame -L 1-3 -L 12-18 HEAD -- somefile.py
This patch supports passing a list/tuple as the value part for kwargs,
so that the generated Git command contain the repeated options.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The a_path and b_path cannot reliably be read from the first diff line
as it's ambiguous. From the git-diff manpage:
> The a/ and b/ filenames are the same unless rename/copy is involved.
> Especially, **even for a creation or a deletion**, /dev/null is not
> 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.
|
|\
| |
| |
| | |
enrich-incremental-blame-output
|
| | |
|
| |
| |
| |
| | |
This enabled getting diff patches for root commits.
|
|/
|
|
|
| |
Returning this now to avoid having to change the function's return value
structure later on if we want to emit more information.
|
|\
| |
| | |
Add incremental blame support
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This adds a sibling method to Repo's blame method:
Repo.blame_incremental(rev, path, **kwargs)
This can alternatively be called using:
Repo.blame(rev, path, incremental=True)
The main difference is that blame incremental is a bit more efficient
and does not return the full file's contents, just the commits and the
line number ranges. The parser is a bit more straight-forward and
faster since the incremental output format is defined a little stricter.
|
| | |
|
|/
|
|
| |
Issue #407
|
| |
|
|
|
|
|
|
| |
This tests the edge case of doing a diff against a single whitespace
filename and returns the proper change type. All other normal usage of
this diff classmethod should remain unchanged.
|
| |
|
|\
| |
| | |
ENH: skip test_is_ancestor on git versions < 1.8.0 not supporting git merge-base --is-ancestor
|
| |
| |
| |
| | |
merge-base --is-ancestor
|
|/
|
|
| |
if used as context managers, the parsers will automatically release their file locks.
|
| |
|
| |
|
|
|
|
|
|
| |
Previously, it could have happened that pipes ran full, deadlocking the operation
Related to #72
|
| |
|
|
|
|
|
|
| |
For more information, see CHANGES.rst
Fixes #369
|
|
|
|
|
|
|
|
|
|
| |
The problem is that a per-tree modification API cannot work properly, as the sorting is based
on full paths of all entries within the repository. This feat can only be achieved by the index,
which to my knowledge already does it correctly.
The only fix is to remove the misleading API entirely, which will happen in the next commit.
Related to #369
|
|
|
|
|
|
|
|
|
| |
Previously it was possible to generate trees which didn't
appear legit to git as gitpython's sorting was a simple alpha-numeric
sort. Git uses one that minimizes literal string comparisons though,
and thus behaves slightly differently sometimes.
Fixes #369
|
|
|
|
|
|
|
|
|
|
|
| |
Similar to git, we now ignore options which have no value.
Previously it would not handle it consistently, and throw a parsing
error the first time the cache was built.
Afterwards, it was fully usable though.
Now we specifically check for the case of no-value options instead.
Closes #349
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As GitPython is in maintenance mode, there will be no new features.
However, I believe it's good idea to explicitly state we do not support
certain things if this is the case.
Therefore, when worktrees are encountered, we will throw an specific
exception to indicate that.
The current implementation is hacky to speed up development,
and increases the risk of failing due to false-positive worktree
directories.
Related to #344
|
|
|
|
|
|
| |
This should fix resource leaking issues once and for all.
Related #304
|
|\
| |
| | |
fix(cmd): make short options with arguments become two separate argum…
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
I really never want to touch python again, and never deal with
py2/3 unicode handling anymore.
By now, it seems pretty much anything is better.
Is python to be blamed for it entirely ?
Probably not, but there are better alternatives.
Nim ? Rust ? Ruby ?
Totally
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously timezones which were not divisable by 3600s would be
parsed correctly, but would serialize into a full hour, rounded up.
Now floating point computation is used which fixes the issue.
Related to #336
|
| |
| |
| |
| |
| |
| |
| | |
Now we select the submodule by name, not by index. The latter is not
deterministic.
Closes #335
|
| |
| |
| |
| |
| |
| |
| |
| | |
It's somewhat more complex to add new commits in submodules to the
parent repository. The new test shows how to do that in a 'GitPythonic'
way.
Related to #335
|
|/
|
|
|
|
|
|
|
| |
This issue only surfaced in python 2, in case paths containing unicode
characters were not actual unicode objects.
In python 3, this was never the issue.
Closes #331
|
|
|
|
|
|
|
|
| |
If the file was not present, the mode seen in a diff can be legally '0',
which previously caused an assertion to fail for no good reason.
Now the assertion tests for None instead.
Closes #323
|
|
|
|
|
| |
Wrap `git merge-base --is-ancestor` into its own function because it acts
as a boolean check unlike base `git merge-base call`
|