Re: [PATCH v2 3/8] cherry-pick: add --skip-empty option
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- Jun 5, 2013, 14:52 UTC
- Message-ID
- <CAMP44s1X=M2sV9OiHS_ggVjmu6txBQVSdK+aK6PnQm5-9EpQgw@mail.gmail.com>
- In-Reply-To
- <7vvc5t7mpm.fsf@alter.siamese.dyndns.org>
On Tue, Jun 4, 2013 at 1:30 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> Felipe Contreras <felipe.contreras@gmail.com> writes: > >> You didn't answer, what happens when you run --skip-empty and --allow-empty? > > I'll answer to a slightly different question: What should happen? > > I think it should error out, because --allow-empty is about > "allowing empty commits to be preserved", and --skip-empty is about > "skipping empty commits (as it says on the package)".
Exactly, so they are related after all. However, --allow-empty says this:
"By default, cherry-picking an empty commit will fail,"
Should we change that too if we introduce --skip-empty?
I don't think so. I think it makes more sense to have a new --empty-commits=[keep|skip|fail] option, so we don't have to document how each option affects the other, and what is the default. Or rather; the option documents that.
In fact, it might make sense to change the default in v2.0 to --empty-commits=skip. If it makes sense in 'git rebase', why doesn't it in 'git cherry-pick'?
-- Felipe Contreras