for example, I don't want any merge happen in Friday. Are there any rules to apply these mandatory restrictions rather than manual judgment?
I have been searching Github documentation well as pygithub documentation as well on how I could get the stats for each users committed and merged lines of code into the master branch from a specific date. So far the best i could find is under contributions it list out a users committed lines of codes however this gives the stats for the life of the project but i need to filter this by a specific date. Is there anyway to do this appreciate the help.
It looks like you can pretty easily retrieve a list of the commits from a specific user and in agiven date range using the pygithub Repository get_commits method. You can see from the method signature below that you can filter by the hash, path, date range, and author.
def get_commits(
self,
sha=github.GithubObject.NotSet,
path=github.GithubObject.NotSet,
since=github.GithubObject.NotSet,
until=github.GithubObject.NotSet,
author=github.GithubObject.NotSet,
)
I am writing Node API to extract data from Github repo.
While doing so, I find a need to count commit for a repo for each day along with date.
I have tried this github api doc
I don't want to do this in this way
https://developer.github.com/v3/repos/commits/
An alternative way of doing this can be is to follow this link down below , but this also do not provide date along with week.
weekly commit count
Any thought/suggestion/help would be appreciated.
Thanks
This might help you:
Git commit count a day
https://www.commandlinefu.com/commands/view/12099/number-of-commits-per-day-in-a-git-repository
Is it possible to find all untagged commits since the latest release using Github API?
First, you can get the latest release with the GitHub API (which matches the matest tag)
GET /repos/:owner/:repo/releases/latest
That means you can then compare two commits:
GET /repos/:owner/:repo/compare/:base...:head
For example: https://api.github.com/repos/git-for-windows/git/compare/v2.4.5.windows.1...master
Notes:
See Working with large comparisons:
The response will include a comparison of up to 250 commits.
If you are working with a larger commit range, you can use the Commit List API to enumerate all commits in the range.
This assume your release was done on the master branch (but you can create a release on another branch)
Quick question on Mercurial. Suppose my colleague and I both have an up to date copy of trunk. We both make changes, then we both push/pull the changes from each other.
I am guessing Mercurial keeps the changes in order based on the date of the commit (since there is no incrementing revision, just a GUID). So what happens if my computer's date is one day behind and I commit half a day after my colleague. Would my change show up half a day before my colleague's?
#Martijn has your correct answer, but it doesn't seem to be clicking. If this makes anything clear pick his:
The commit times on Mercurial changesets have absolutely nothing to do with how they're merged, interleaved, or combined
Mercurial, and other DVCs, do all history tracking based entirely on the DAG (Directed Acyclic Graph), which means:
the only piece of metadata that matters is the parent or parents of a changeset
Before you commit you can see what the parent of your changeset is going to be by typing hg parents and once you commit you can see it in the hg log.
In your examples if you've pulled your colleague's changesets and updated your working directory to reflect them (hg pull ; hg update) then his or her changeset will be the parent of your changeset. If you haven't pulled/updated to reflect his or her changeset then both of your changesets will have the same parent -- they'll be siblings -- when when they're merged neither will take precedence over the other in any way.
The ordering when you do a hg log is determined by the order in which the changeset arrived in your local repository, and can differ from repo to repo depending on where they've pulled from first -- that's why you can't use the integer numbers shown next to changesets for cross-repo operations -- only the hash is global.
In short the date is never consulted in normal operations and is purely metadata with no more relevance than the author or commit description.
Indeed, your changesets are timestamped (internally stored as seconds-since-the-UNIX-epoch and a timezone offset), and when displaying changeset, they are ordered by timestamp and your changesets will be displayed in the incorrect place as their timestamps are be incorrect. See https://www.mercurial-scm.org/wiki/ChangeSet
This is not really that much of a problem though; timestamps have no bearing on how your changes are merged with those of your colleague. Only the changeset IDs matter here and when merging a common ancestor is used. It'll follow the graph of your changesets down looking for a changeset ID that your colleague also has and then merges your and his changes from the on forward. See https://www.mercurial-scm.org/wiki/Merge
So, merges are not affected, only the display of changesets, where your changesets will be sorted into the wrong location. It'll confuse you and your colleague, but your changes themselves are safe.
The order of changesets is not affected by the timestamp in the changesets. The order is determined solely by the order in which the changesets were created in your local repository.
Mercurial has an append-only architecture so when you pull from another repository, the changesets you pull in are placed after your own changesets, regardless of the timestamps in the new changesets.
The revision numbers (the local integer counter) is just a counter: each new changeset gets the next available revision number. The simple range operator in Mercurial works directly on revisions numbers, and so X:Y means "give me changesets with revision numbers from X to Y (inclusive)". This is not so useful when the revision numbers are based only on the order in which changesets were created or pulled into a repository.
Use X::Y instead, that gives you changesets that are descendants of X and ancestors of Y, i.e., it follows the branches in the history.