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

Re: [PATCH] branch.c: delete size check of newly tracked branch names

From
Duy Nguyen <pclouds@gmail.com>
Date
Feb 28, 2014, 11:41 UTC
Message-ID
<CACsJy8A7jVM1wdU2BK-NyQ5HJoY_19oKhSXCKqV_7qNN+OA+mw@mail.gmail.com>
In-Reply-To
<1393585744-2569-1-git-send-email-jacopo.notarstefano@gmail.com>

On Fri, Feb 28, 2014 at 6:09 PM, Jacopo Notarstefano <jacopo.notarstefano@gmail.com> wrote:

Show 10 quoted lines
> Since commit 6f084a56 the length of a newly tracked branch name was limited
> to 1019 = 1024 - 7 - 7 - 1 characters, a bound derived by having to store
> this name in a char[1024] called key with two strings of length at most 7
> and a '\0' character.
>
> This was no longer necessary as of commit a9f2c136, which uses a strbuf
> (documented in Documentation/technical/api-strbuf.txt) to store this value.
>
> This patch removes this unneeded check and thus allows for branch names
> longer than 1019 characters.

Nice. new_ref is passed in install_branch_config() in latest code. I guess you already made sure this function did not make any assumption about new_ref's length?

Show 31 quoted lines
>
> Signed-off-by: Jacopo Notarstefano <jacopo.notarstefano@gmail.com>
> ---
>
> Submitted as GSoC microproject #3.
>
>  branch.c | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/branch.c b/branch.c
> index 723a36b..05feaff 100644
> --- a/branch.c
> +++ b/branch.c
> @@ -114,10 +114,6 @@ static int setup_tracking(const char *new_ref, const char *orig_ref,
>         struct tracking tracking;
>         int config_flags = quiet ? 0 : BRANCH_CONFIG_VERBOSE;
>
> -       if (strlen(new_ref) > 1024 - 7 - 7 - 1)
> -               return error(_("Tracking not set up: name too long: %s"),
> -                               new_ref);
> -
>         memset(&tracking, 0, sizeof(tracking));
>         tracking.spec.dst = (char *)orig_ref;
>         if (for_each_remote(find_tracked_branch, &tracking))
> --
> 1.9.0.1.g5abca64
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-- 
Duy
Previous: Jacopo NotarstefanoNext: Jacopo Notarstefano
Message 3 of 5 in “branch.c: delete size check of newly tracked branch names”
  1. branch.c: delete size check of newly tracked branch namesJacopo Notarstefano, Feb 28, 2014
  2. Jacopo NotarstefanoFeb 28, 2014
  3. Duy NguyenFeb 28, 2014
  4. Jacopo NotarstefanoFeb 28, 2014
  5. Duy NguyenFeb 28, 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.