git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH][GSoC]simplified branch.c:install_branch_config() if() statement

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Mar 11, 2014, 08:11 UTC
Message-ID
<CAPig+cT2You1WLkyoWbwo84xMQGyyeu6t0HB7tcsnyN+HxiLLQ@mail.gmail.com>
In-Reply-To
<loom.20140311T081018-894@post.gmane.org>
On Tue, Mar 11, 2014 at 3:16 AM, Nemina Amarasinghe <neminaa@gmail.com> wrote:
> Subject: simplified branch.c:install_branch_config() if() statement
Use imperative tone: "simplify ..."
> I hope this is the correct format for  patch. Please comment on this if
> something is wrong.

This commentary is relevant to the email discussion but not to the commit description, so it should be placed below the "---" line just under your sign-0ff.

Show 24 quoted lines
> Signed-off-by:Nemina Amarasinghe <neminaa@gmail.com>
> ---
>  branch.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/branch.c b/branch.c
> index 0304a7a..fd93603 100644
> --- a/branch.c
> +++ b/branch.c
> @@ -87,12 +87,7 @@ void install_branch_config(int flag, const char *local,
> const char *origin, cons
>                                   _("Branch %s set up to track local branch %s by rebasing.") :
>                                   _("Branch %s set up to track local branch %s."),
>                                   local, shortname);
> -               else if (!remote_is_branch && origin)
> -                       printf_ln(rebasing ?
> -                                 _("Branch %s set up to track remote ref %s by rebasing.") :
> -                                 _("Branch %s set up to track remote ref %s."),
> -                                 local, remote);
> -               else if (!remote_is_branch && !origin)
> +               else if (!remote_is_branch)
>                         printf_ln(rebasing ?
>                                   _("Branch %s set up to track remote ref %s by rebasing.") :
>                                   _("Branch %s set up to track remote ref %s."),
The patch itself is broken in a couple ways.

First, it is whitespace-damaged, possibly due to being pasted into your email client. Using "git send-email" can help avoid this problem.

Second, the code against which this patch was made does not exist in git.git. You are likely making this change atop some other local modifications which you already made. Simplest at this point would probably be for you to make a fresh clone of git.git and start from scratch by editing branch.c in the 'master' branch.

> --
> 1.9.0.152.g6ab4ae2
Previous: Nemina Amarasinghe
Message 14 of 14 in “simplified the chain if() statements of install_branch_config() function in branch.c”
  1. simplified the chain if() statements of install_branch_config() function in branch.cNemina Amarasinghe, Mar 10, 2014
  2. Nemina AmarasingheMar 10, 2014
  3. Matthieu MoyMar 10, 2014
  4. David KastrupMar 10, 2014
  5. Nemina AmarasingheMar 10, 2014
  6. Matthieu MoyMar 10, 2014
  7. David KastrupMar 10, 2014
  8. Nemina AmarasingheMar 10, 2014
  9. David KastrupMar 10, 2014
  10. Eric SunshineMar 10, 2014
  11. Nemina AmarasingheMar 11, 2014
  12. Eric SunshineMar 11, 2014
  13. Nemina AmarasingheMar 11, 2014
  14. Eric SunshineMar 11, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.