# [PATCH] remote: fix status with branch...rebase=preserve

3 messages from 2013-12-07 to 2013-12-09. Participants: Felipe Contreras, Junio C Hamano.
Thread: https://gitlist.dev/t/35493

## Felipe Contreras, 2013-12-07 13:08

Subject: [PATCH] remote: fix status with branch...rebase=preserve
Message-ID: <1386421717-27698-1-git-send-email-felipe.contreras@gmail.com>
URL: https://gitlist.dev/e/1386421717-27698-1-git-send-email-felipe.contreras%40gmail.com

```
Commit 66713ef (pull: allow pull to preserve merges when rebasing)
didn't include an update so 'git remote status' parses branch.<name>.rebase=preserve
correctly, let's do that.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 builtin/remote.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/builtin/remote.c b/builtin/remote.c
index 4e14891..5e4ab66 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -309,8 +309,13 @@ static int config_read_branches(const char *key, const char *value, void *cb)
 				space = strchr(value, ' ');
 			}
 			string_list_append(&info->merge, xstrdup(value));
-		} else
-			info->rebase = git_config_bool(orig_key, value);
+		} else {
+			int v = git_config_maybe_bool(orig_key, value);
+			if (v >= 0)
+				info->rebase = v;
+			else if (!strcmp(value, "preserve"))
+				info->rebase = 1;
+		}
 	}
 	return 0;
 }
-- 
1.8.4.2+fc1

```

## Junio C Hamano, 2013-12-09 21:16

Subject: Re: [PATCH] remote: fix status with branch...rebase=preserve
Message-ID: <xmqqmwk9wwql.fsf@gitster.dls.corp.google.com>
URL: https://gitlist.dev/e/xmqqmwk9wwql.fsf%40gitster.dls.corp.google.com
In-Reply-To: <1386421717-27698-1-git-send-email-felipe.contreras@gmail.com>

```
Felipe Contreras <felipe.contreras@gmail.com> writes:

> Commit 66713ef (pull: allow pull to preserve merges when rebasing)
> didn't include an update so 'git remote status' parses branch.<name>.rebase=preserve
> correctly, let's do that.
>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
>  builtin/remote.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/builtin/remote.c b/builtin/remote.c
> index 4e14891..5e4ab66 100644
> --- a/builtin/remote.c
> +++ b/builtin/remote.c
> @@ -309,8 +309,13 @@ static int config_read_branches(const char *key, const char *value, void *cb)
>  				space = strchr(value, ' ');
>  			}
>  			string_list_append(&info->merge, xstrdup(value));
> -		} else
> -			info->rebase = git_config_bool(orig_key, value);
> +		} else {
> +			int v = git_config_maybe_bool(orig_key, value);
> +			if (v >= 0)
> +				info->rebase = v;
> +			else if (!strcmp(value, "preserve"))
> +				info->rebase = 1;
> +		}

Looks correct.  Do we want to add a test?

>  	}
>  	return 0;
>  }

```

## Junio C Hamano, 2013-12-09 21:18

Subject: Re: [PATCH] remote: fix status with branch...rebase=preserve
Message-ID: <xmqqiouxwwn7.fsf@gitster.dls.corp.google.com>
URL: https://gitlist.dev/e/xmqqiouxwwn7.fsf%40gitster.dls.corp.google.com
In-Reply-To: <1386421717-27698-1-git-send-email-felipe.contreras@gmail.com>

```
Thanks, will queue.

```
