<div dir="auto"><div><div class="gmail_extra"><div class="gmail_quote">On Mar 31, 2017 10:48 AM, "Victor Stinner" <<a href="mailto:victor.stinner@gmail.com">victor.stinner@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
The CPython repository was converted from Mercurial to Git. Before<br>
with Mercurial, we used extensively merges. For example, a bug was<br>
fixed in branche 3.5, merged into 3.6 and then merged into master.<br>
With the conversion to Git, some merges commit are removed, some<br>
others are kept.<br>
<br>
My question is how to list commits which are only part of the "master"<br>
branch, as "hg log default" in Mercurial. "git log origin/master"<br>
lists also commits coming from 3.x branches and their merges. The<br>
problem is that if you pick a commit from a different branch, you<br>
compile Python 3.x, instead of compiling Python for the master branch.<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">I think you want:</div><div dir="auto"><br></div><div dir="auto">git log --no-merges --first-parent</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Right now, my need is to find the first commit in the "master" branch<br>
after a specific date. For example, find the first commit after<br>
2016-01-01 00:00.<br>
<br>
Naive solution:<br>
---<br>
$ git log --since="2016-01-01 00:00" origin/master --reverse|head</blockquote></div></div></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
commit 75e3630c6071819d3674d956ea754c<wbr>cb4fed5271<br>
Author: Benjamin Peterson <<a href="mailto:benjamin@python.org">benjamin@python.org</a>><br>
Date:   Fri Jan 1 10:23:45 2016 -0600<br>
<br>
    2016 will be another year of writing copyrighted code<br>
---<br>
<br>
If you compile the revision 75e3630c6071819d3674d956ea754c<wbr>cb4fed5271,<br>
you get Python 3.3:<br>
---<br>
$ grep PY_M Include/patchlevel.h<br>
#define PY_MAJOR_VERSION    3<br>
#define PY_MINOR_VERSION    3<br>
#define PY_MICRO_VERSION    6<br>
---<br>
<br>
But if you exclude manually commits which are in branches 3.x, you get<br>
the commit 71db903563906cedfc098418659d12<wbr>00043cd14c which gives a<br>
different Python version:<br>
---<br>
$ grep PY_M Include/patchlevel.h<br>
#define PY_MAJOR_VERSION    3<br>
#define PY_MINOR_VERSION    6<br>
#define PY_MICRO_VERSION    0<br>
---<br>
<br>
In fact, I wrote a tool to manually exclude commits of branches 3.x:<br>
<br>
<a href="https://github.com/haypo/misc/blob/master/misc/find_git_revisions_by_date.py" rel="noreferrer" target="_blank">https://github.com/haypo/misc/<wbr>blob/master/misc/find_git_<wbr>revisions_by_date.py</a><br>
<br>
But it's super slow! Are there builtin options to only show Git<br>
commits which are in master branch but not in 3.x branches?<br>
<br>
Asked differently: how can I only see two commits on the following<br>
range? What are [options]?<br>
<br>
git rev-list 288cb25f1a208fe09b9e06ba479e11<wbr>c1157da4b5..<wbr>71db903563906cedfc098418659d12<wbr>00043cd14c<br>
[options]<br>
<br>
Commits after 2016-01-01:<br>
---<br>
$ git checkout 71db903563906cedfc098418659d12<wbr>00043cd14c<br>
$ git log --graph<br>
*   commit 71db903563906cedfc098418659d12<wbr>00043cd14c<br>
|\  Merge: 288cb25 4c70293<br>
| | Author: Benjamin Peterson <<a href="mailto:benjamin@python.org">benjamin@python.org</a>><br>
| | Date:   Fri Jan 1 10:25:22 2016 -0600<br>
| |<br>
| |     merge 3.5<br>
| |<br>
| *   commit 4c70293755ce8ea0adc5b224c714da<wbr>2b7625d232<br>
| |\  Merge: 42bf8fc e8c2a95<br>
| | | Author: Benjamin Peterson <<a href="mailto:benjamin@python.org">benjamin@python.org</a>><br>
| | | Date:   Fri Jan 1 10:25:12 2016 -0600<br>
| | |<br>
| | |     merge 3.4<br>
| | |<br>
| | *   commit e8c2a957c87980a1fd79c39597d40e<wbr>5c5aeb7048<br>
| | |\  Merge: 52d6c2c 75e3630<br>
| | | | Author: Benjamin Peterson <<a href="mailto:benjamin@python.org">benjamin@python.org</a>><br>
| | | | Date:   Fri Jan 1 10:24:21 2016 -0600<br>
| | | |<br>
| | | |     merge 3.3<br>
| | | |<br>
| | | * commit 75e3630c6071819d3674d956ea754c<wbr>cb4fed5271<br>
| | | | Author: Benjamin Peterson <<a href="mailto:benjamin@python.org">benjamin@python.org</a>><br>
| | | | Date:   Fri Jan 1 10:23:45 2016 -0600<br>
| | | |<br>
| | | |     2016 will be another year of writing copyrighted code<br>
| | | |<br>
* | | |   commit 288cb25f1a208fe09b9e06ba479e11<wbr>c1157da4b5<br>
|\ \ \ \  Merge: 58f8833 42bf8fc<br>
| |/ / /  Author: Serhiy Storchaka <<a href="mailto:storchaka@gmail.com">storchaka@gmail.com</a>><br>
| | | |   Date:   Wed Dec 30 21:41:53 2015 +0200<br>
| | | |<br>
| | | |       Issue #25961: Disallowed null characters in the type name.<br>
| | | |       Simplified testing for null characters in __name__ setter.<br>
| | | |<br>
---<br>
<br>
Victor<br>
______________________________<wbr>_________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/rymg19%40gmail.com" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/options/python-dev/<wbr>rymg19%40gmail.com</a><br>
</blockquote></div><br style="font-family:sans-serif"><br style="font-family:sans-serif"><div data-smartmail="gmail_signature" style="font-family:sans-serif" dir="auto">--<br>Ryan (ライアン)<br>Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else<br><a href="http://refi64.com">http://refi64.com</a></div></div></div></div>