-
Notifications
You must be signed in to change notification settings - Fork 8
Change GitChanges so it compares against the remote #18
base: master
Are you sure you want to change the base?
Conversation
The previous version was comparing against HEAD~1 which would: A. Miss any changes prior to that of the last commit that had not yet been pushed B. Grab changes not necessarily made by the current user (for example if the current user only had staged changes but no commits, HEAD~1 would grab those changes as well as the changes from the last commit)
hmmm looks like the ci build timed out |
sorry for late reply. thank you for your contributions.
it is not you matter. don't worry. please check my understanding first. I tried |
I thought that change can get this command: |
cool! it can't pick up unstaged changes. but it is better than now. |
@@ -18,6 +18,9 @@ optimist.boolean('single-thread'); | |||
optimist.boolean('changes'); | |||
optimist.default('changes', false); | |||
|
|||
optimist.string('git-remote'); | |||
optimist.default('git-remote', 'origin'); |
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.
please replace origin
to master...HEAD
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.
The only reason I didn't opt for that approach was that it always compares against master
. What I was going for with the origin
approach was to compare against the current branch's tracked remote branch. The issue you might be seeing is that the branch you are working off of doesn't exist in the remote repo. I am not sure I tested that case, but I will do so shortly to confirm.
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.
hmmm I just ran git diff --name-only origin
on a brach that isn't in the remote repo and it worked correctly for me (showing in the diagram above both the committed and unstaged changes that were not yet pushed to origin
, essentially everything I have done locally since the last pull/rebase).
What were you seeing for results?
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.
is your remote named origin
? I am assuming yes because that is the default behavior, but just double checking.
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.
sorry for late reply.
I tried git diff --name-only origin
. but it failed.
$ git branch
* jdonaghue-master
master
refactor-code-format
use-es6-default
$ git diff --name-only origin
fatal: ambiguous argument 'origin': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
is that command works fine in all situations?
$ git remote -v 128 ↵
base [email protected]:DefinitelyTyped/definition-tester.git (fetch)
base [email protected]:DefinitelyTyped/definition-tester.git (push)
origin [email protected]:vvakame/definition-tester.git (fetch)
origin [email protected]:vvakame/definition-tester.git (push)
$ git diff --name-only base
fatal: ambiguous argument 'base': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
The previous version was comparing against HEAD
1 which would:1 would grabA. Miss any changes prior to that of the last commit that had not yet been pushed
B. Grab changes not necessarily made by the current user (for example
if the current user only had staged changes but no commits, HEAD
those changes as well as the changes from the last commit)