New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow reviewing individual commits #43
base: master
Are you sure you want to change the base?
Conversation
2f80101
to
20fdea2
Compare
Tested end to end on 0581a60 |
At testing one observation if found.
|
What do you mean by does not pick up? When you call |
Yes. E.g I commented today on a commit And that comment follows the patch itself. It does not show up via
What I receive is the description and the diff. I pointed to |
Here is a patch that I sketched to fix the comments delivery, briefly tested. |
7fc0a3e
to
7dc28e8
Compare
Your patch looks good, I added it and I will rewrite the author's name to match your name and email. I also added support for urls referring to commit in PRs. @andrelkin feel free to test it again. I am planning to refactor, test and merge this in the coming week. |
@andrelkin could you please take another look? Thanks |
Same entry point as for PR.
3c0b1cc
to
509a21f
Compare
Salute, @charignon ! I somewhat tested patches of Jul 4th. Now turning to test lc--mvp-review-commit branch. Thanks for the invite :-)! |
Does not seem to work correctly in the plain commit case now. I am investigating what is wrong later today. |
My testing env was not clean. This branch actually works for me. Thanks! |
Actually, I can't make my comments, formatted as specified and sent via github-review-comment, to land to the commit page.
# Could you please refer to the orginal patches with git commit id:s. was also tried without the space after '#', still with the same outcome. |
I think I recognized the issue in |
So the problem of posting comments on commit is caused by generated
makes the posting of a comment in the header of commit ( not inside the diff) to succeed. |
The posting issue is resolved after I fully understood it. The following hunk
|
Even though a reported above issue fixed I am still working on reviewing, testing and some improving. I think the best if I'll proceed with a PR on my own that bases on this |
(defun github-review-get-commit-diff (commit-alist callback) | ||
"Get the diff for a commit, given COMMIT-ALIST an alist recommitesenting a COMMIT. | ||
CALLBACK is called with the result" | ||
(github-review-get-commit commit-alist t callback)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there should be just one getter-function github-review-get-object
that
accepts object-id-alist
from which it and its callees find out what
kind of PR
or COMMIT
the object is.
E.g github-review-get-commit
is different from github-review-get-pr
only that
it passes in alist
sha
-keyed value rather than num
-keyed one to
github-review-format-commit-url
.
So which one is passed needs checking and then to conduct a respecive specific branch of logics.
As another example here is a generalized function to save retrieved object:
+(defun github-review-save-diff (id-alist diff)
+ "Save a DIFF (string) to a temp file named after pr or commit sha specified by ID-ALIST."
+ (let* ((is-pr (> (string-to-number (github-review-a-get id-alist 'num)) 0)))
+ (find-file (format (if is-pr "%s/%s___%s___%s.diff" "%s/%s___%s___commit___%s.diff")
+ github-review-review-folder
+ (github-review-a-get id-alist 'owner)
+ (github-review-a-get id-alist 'repo)
+ (github-review-a-get id-alist (if is-pr 'num 'sha))))
+ (buffer-read-only nil)
+ (erase-buffer)
+ (insert diff)
+ (save-buffer)
+ (when github-do-review-mode
+ (github-review-mode))))
If you won't have any objections I'm going to generalize all such "paired" functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you send out a PR with that and we can discuss there? Thanks!
I am cleaning it up. Need few days to complete that (considering the size of my primary load :-)). |
My forked branch is mostly done. I just need to rebase its commits into 2 or 3 for easier reviewing. Must be finishing this weekend. |
Pr is done - #63. Thanks for your patience! I am eager to hear from you, dear @charignon ,or anybody to improve if anything. |
Same entry point as for PR.