Re: [PATCH v4 10/10] rebase -i: rearrange fixup/squash lines using the rebase--helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Liam,

On Thu, 25 May 2017, Liam Beguin wrote:

> Johannes Schindelin <johannes.schindelin@xxxxxx> writes:
> [...]
> > +	if (rearranged) {
> > +		struct strbuf buf = STRBUF_INIT;
> > +
> > +		for (i = 0; i < todo_list.nr; i++) {
> > +			enum todo_command command = todo_list.items[i].command;
> > +			int cur = i;
> > +
> > +			/*
> > +			 * Initially, all commands are 'pick's. If it is a
> > +			 * fixup or a squash now, we have rearranged it.
> > +			 */
> > +			if (is_fixup(command))
> > +				continue;
> > +
> > +			while (cur >= 0) {
> > +				int offset = todo_list.items[cur].offset_in_buf;
> > +				int end_offset = cur + 1 < todo_list.nr ?
> > +					todo_list.items[cur + 1].offset_in_buf :
> > +					todo_list.buf.len;
> > +				char *bol = todo_list.buf.buf + offset;
> > +				char *eol = todo_list.buf.buf + end_offset;
> 
> I got a little confused with these offsets. I know it was part of a
> previous series, but maybe we could add a description to the fields
> of `struct todo_list` and `struct todo_item`.

You mean "offset_in_buf"?

Sure, I can add a comment there. I would like to keep it out of this patch
series, though, as the purpose of it is to accelerate rebase -i by moving
logic from the (slow) shell script code to the (decently fast) C code.

Ciao,
Johannes



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]