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
log from non-ancestor lists symmetric difference - should list simple difference #286
Comments
This feature is useful in some cases. Is there any plan on adding this feature? |
We had worked around this by not providing
I still think it's a bug that simple-git returns the symmetric difference instead of the simple difference. If backwards compatibility is an issue, maybe a new option |
Thanks @csemrau |
You can add extra command line arguments using the usual how-to-specify-options. There is now a test is test-log.js that shows how to add the options in. If you would like to have a new custom option for setting some properties, please feel free to modify git.js accordingly and open a PR. If you would like for this to go on the backlog for my input, please can you add a test in |
Fixes in #352 are now in NPM as version 1.113.0 |
We are trying to get a list of commits that are part of a feature branch, but not yet part of the master branch. Using
git log master..feature
yields those commits, regardless of whether the master branch contains additional commits. Is it possible with simple-git?The simple-git
log
command logs a commit range given byopt.from + "..." + opt.to
, with 3 dots. This produces the symmetric difference, containing all commits fromfrom
not into
together with all commits fromto
not infrom
.I expect to get a log of all commits in
to
that are not also infrom
, which you would get when giving the range with only 2 dots,opt.from + ".." + opt.to
.In the current implementation, that makes
from
andto
interchangeable and yields unexpected results wheneverfrom
is not an ancestor ofto
.As an example, take the following history:
The command
git log master..feature
lists onlyD
, because that is the only commit that is in the history offeature
and not also in the history ofmaster
. Similarly,git log master..feature
lists onlyC
, the only commit onmaster
that's not yet infeature
.Whereas
git log master...feature
lists bothC
andD
, because these two commits are not common to both (likeA
andB
) or absent from both (likeE
). This is also the result of the simple-gitlog
call with{from:'master', to:'feature'}
.The text was updated successfully, but these errors were encountered: