Commit Diff

Issue #66 wontfix
Maurizio Masala created an issue

Hi, can you add a new class to show diff by commit? It's possibile by calling

return $this->getClient()->setApiVersion('2.0')->get(
            sprintf('repositories/%s/%s/diff/%s', $account, $repo, $revision)
        );

It returns a simple git diff command string, like this

diff --git a/my/scipt/Class.php
index 649c75c..eb83e3c 100644
--- a/my/scipt/Class.php
+++ b/my/scipt/Class.php
@@ -218,7 +218,7 @@ class MyScript  {
        }
        [... some diff code ...]

I attached the class (just the method "get")

For my personal scripts, I use

preg_match_all('/diff \-\-git\s[ab]\/(.*)/', $result, $matches);

to get only the list of files that have changed.

Thanks, bye

Comments (3)

  1. Alexandru Guzinschi

    Thank you for your time and interest in helping out, but please read Contributing document first.

    Although the content of that file could sound a little drastic, I am willing to merge code without documentation and taking the task of writing it myself, I am also willing to receive patches if you don't like PR's for some reason, but I don't plan to apply changes to the code base without tests. Sorry.

  2. Log in to comment