Re: [WIP/RFH] format-patch: Allow diffs for first-parent history
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Dec 8, 2010, 10:52 UTC
- Message-ID
- <20101208105209.GA4947@burratino>
- In-Reply-To
- <f60b93ae61c0e3088112cd6e1185d9c66f623813.1291803440.git.git@drmicha.warpmail.net>
Michael J Gruber wrote:
> The attached patch teaches format-patch not to ignore merges (on > "--first-parent"), but I failed to track how "diff-tree" sets options > based on "-m"
With hindsight, here's a search result:
$ git grep -e argv -- builtin/diff-tree.c
int cmd_diff_tree(int argc, const char **argv, const char *prefix)
argc = setup_revisions(argc, argv, opt, &s_r_opt);
const char *arg = *++argv;So it's setup_revisions, in revision.c, which clears revs->ignore_merges when -m is detected.
Maybe it should clear revs->no_merges while at it? I can't see any other meaningful meaning for
git alias.lg "log --no-merges" git lg -m HEAD~2..HEAD
or
git format-patch -m --first-parent HEAD~2..HEAD
Meanwhile I would also be happy to see --first-parent imply -m, though that might be more controversial since -p -c --first-parent and -p --cc --first-parent are also meaningful.