Re: Bug: no-op "rebase -i" failures (easily reproduceable)

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

 



Luiz-Otavio Zorzella <zorzella@xxxxxxxxx> writes:

> $ EDITOR=echo git rebase -i HEAD~40
> /usr/local/google/z/gitblow/git/.git/rebase-merge/git-rebase-todo
> error: could not apply ec7ff5b... make lineno_width() from blame
> reusable for others
>
> When you have resolved this problem run "git rebase --continue".
> If you would prefer to skip this patch, instead run "git rebase --skip".
> To check out the original branch and stop rebasing run "git rebase --abort".
> Could not apply ec7ff5b... make lineno_width() from blame reusable for others

That is hardly surprising, given that you asked to flatten the history
since the 40 commits before the tip of your history, and it is done out of
a history that is full of merges from side branches.

And it is not even an error, let alone a bug.  The command is asking you
to resolve conflict it cannot resolve mechanically.  If you do as you are
asked, you will do just fine.

It is expected that you will see conflicts in such a rebase, because by
attempting to flatten the history you are telling Git to replay a commit
to a context that is different from its original context.

A conflict resolution to replay that particular commit to flatten a recent
history might look like this, but it depends on where in the history you
start the rebase from.

diff --cc cache.h
index 3a8e125,24732e6..0000000
--- a/cache.h
+++ b/cache.h
@@@ -1177,7 -1176,7 +1177,8 @@@ extern void setup_pager(void)
  extern const char *pager_program;
  extern int pager_in_use(void);
  extern int pager_use_color;
 +extern int term_columns(void);
+ extern int decimal_width(int);
  
  extern const char *editor_program;
  extern const char *askpass_program;
diff --cc pager.c
index b790967,96c07ba..0000000
--- a/pager.c
+++ b/pager.c
@@@ -118,32 -112,13 +118,44 @@@ int pager_in_use(void
  }
  
  /*
 + * Return cached value (if set) or $COLUMNS environment variable (if
 + * set and positive) or ioctl(1, TIOCGWINSZ).ws_col (if positive),
 + * and default to 80 if all else fails.
 + */
 +int term_columns(void)
 +{
 +	static int term_columns_at_startup;
 +
 +	char *col_string;
 +	int n_cols;
 +
 +	if (term_columns_at_startup)
 +		return term_columns_at_startup;
 +
 +	term_columns_at_startup = 80;
 +
 +	col_string = getenv("COLUMNS");
 +	if (col_string && (n_cols = atoi(col_string)) > 0)
 +		term_columns_at_startup = n_cols;
 +#ifdef TIOCGWINSZ
 +	else {
 +		struct winsize ws;
 +		if (!ioctl(1, TIOCGWINSZ, &ws) && ws.ws_col)
 +			term_columns_at_startup = ws.ws_col;
 +	}
 +#endif
 +
 +	return term_columns_at_startup;
 +}
++
++/*
+  * How many columns do we need to show this number in decimal?
+  */
+ int decimal_width(int number)
+ {
+ 	int i, width;
+ 
+ 	for (width = 1, i = 10; i <= number; width++)
+ 		i *= 10;
+ 	return width;
+ }
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]