Re: [PATCH 2/3] rebase -i --keep-empty: don't prune empty commits

2018-03-29 Thread Junio C Hamano
Johannes Schindelin writes: >> But I wonder if this is even easier to follow. It makes it even >> more clear that patchsame commits that are not empty are discarded >> unconditionally. >> >> while ((commit = get_revision())) { >> int is_empty =

Re: [PATCH 2/3] rebase -i --keep-empty: don't prune empty commits

2018-03-21 Thread Johannes Schindelin
Hi Junio, On Tue, 20 Mar 2018, Junio C Hamano wrote: > Johannes Schindelin writes: > > >> + if (!keep_empty && is_empty) > >>strbuf_addf(, "%c ", comment_line_char); > > We are not trying to preserve an empty one, and have found an

Re: [PATCH 2/3] rebase -i --keep-empty: don't prune empty commits

2018-03-20 Thread Phillip Wood
On 20/03/18 17:34, Junio C Hamano wrote: > Johannes Schindelin writes: > >>> + if (!keep_empty && is_empty) >>> strbuf_addf(, "%c ", comment_line_char); > > We are not trying to preserve an empty one, and have found an empty > one, so we

Re: [PATCH 2/3] rebase -i --keep-empty: don't prune empty commits

2018-03-20 Thread Junio C Hamano
Johannes Schindelin writes: >> +if (!keep_empty && is_empty) >> strbuf_addf(, "%c ", comment_line_char); We are not trying to preserve an empty one, and have found an empty one, so we comment it out, and then... >> +if

Re: [PATCH 2/3] rebase -i --keep-empty: don't prune empty commits

2018-03-20 Thread Johannes Schindelin
Hi Phillip, On Tue, 20 Mar 2018, Phillip Wood wrote: > diff --git a/sequencer.c b/sequencer.c > index 4d3f60594c..96ff812c8d 100644 > --- a/sequencer.c > +++ b/sequencer.c > @@ -2470,7 +2470,7 @@ int sequencer_make_script(FILE *out, int argc, const > char **argv, > init_revisions(, NULL);

[PATCH 2/3] rebase -i --keep-empty: don't prune empty commits

2018-03-20 Thread Phillip Wood
From: Phillip Wood If there are empty commits on the left hand side of $upstream...HEAD then the empty commits on the right hand side that we want to keep are pruned by --cherry-pick. Fix this by using --cherry-mark instead of --cherry-pick and keeping the commits