RoshanKumar Mutha
RoshanKumar Mutha

Reputation: 2445

How to differentiate git pull request commit and direct checkin commit?

How to differentiate git pull request commit and direct checkin commit to a branch using git api or command line ?

Why i need this?

I need to findout how to get all direct checkins which bypassed pull request mechanism...

Upvotes: 1

Views: 422

Answers (2)

André Gasser
André Gasser

Reputation: 1105

Pure Git as a version control system is not aware of any pull request functionality. There is no reference to something like this in the official documentation. The pull request feature is provided by services such as github.com and bitbucket.org as additional functionality.

But nevertheless, if you merge a branch into another using a pull request on one of these platforms, you might be able to distinct merges via pull requests from direct merges by inspecting the commit messages of the merge. I have just checked one of my github.com repositories. There, the commit messages coming from pull requests look like this: "Merge pull request #8 from foo/bar", where foo/bar represents the source branch. You might therefore be able to differentiate by looking for such preformatted commit messages.

Upvotes: 2

eftshift0
eftshift0

Reputation: 30204

From git's point of view, there's no difference between a revision that came from a PR and another that was just committed and pushed. That might be information you could get from your provider if you are using bitbucket or github (and I say could in the sense that I have no idea if they make it available somehow). But on git's DB? There's nothing about that, to the best of my knowledge.

Upvotes: 0

Related Questions