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

Re: Error pushing new branch: value too great for base (error token is...

From
Gaurav Chhabra <varuag.chhabra@gmail.com>
Date
Aug 10, 2015, 09:54 UTC
Message-ID
<CAGDgvc1FJ0K+OLQBj8iXPCnqMFyBD3mp32k0aTztQkKKuxNxtQ@mail.gmail.com>
In-Reply-To
<CAGDgvc2hc+f5CuPXc2pr5uYd9kniVpuffrb6z416CicxBgVxJQ@mail.gmail.com>

Apologies for the delay in reply! I tried your suggestion and it works. Thanks! :)

I'm curious why integer comparison is throwing error. Shouldn't i be comparing numbers with numeric operator?

On Mon, Aug 10, 2015 at 3:23 PM, Gaurav Chhabra <varuag.chhabra@gmail.com> wrote:

Show 41 quoted lines
> Apologies for the delay in reply! I tried your suggestion and it works.
> Thanks! :)
>
> I'm curious why integer comparison is throwing error. Shouldn't i be
> comparing numbers with numeric operator?
>
>
> On Wed, Aug 5, 2015 at 11:23 PM, Eric Sunshine <sunshine@sunshineco.com>
> wrote:
>>
>> On Wed, Aug 5, 2015 at 1:32 PM, Gaurav Chhabra <varuag.chhabra@gmail.com>
>> wrote:
>> > I had written the following code to check whether a push is for branch
>> > deletion:
>> >
>> > #!/bin/bash
>> >
>> > NULL="0000000000000000000000000000000000000000"
>> >     if [[ "$new_sha" -eq "$NULL" ]]; then   # Line 17
>> > remote: Stdin: [0000000000000000000000000000000000000000]
>> > [9226289d2416af4cb7365d7aaa5e382bdb3d9a89] [refs/heads/rel-a]
>> > remote:
>> > remote: hooks/pre-receive: line 17: [[:
>> > 9226289d2416af4cb7365d7aaa5e382bdb3d9a89: value too great for base
>> > (error token is "922628
>> > 9d2416af4cb7365d7aaa5e382bdb3d9a89")
>> >
>> > Although the new branch gets pushed to remote but i'm not sure why i'm
>> > getting this error and how can i fix it. I checked online and i get
>> > few links where folks had similar issue but in each such case, the
>> > error token was 08 or 09. I still tried the suggestion of using "10#"
>> > in front of my $new_sha variable but to no avail.
>> >
>> > Any suggestions?
>>
>> Yes, try using the string comparison '=' operator rather than the
>> numeric comparison operator '-eq'.
>>
>>     if [[ "$new_sha" = "$NULL" ]]; then
>
>
Previous: Eric SunshineNext: Jacob Keller
Message 3 of 6 in “Error pushing new branch: value too great for base (error token is...”
  1. Gaurav ChhabraAug 5, 2015
  2. Eric SunshineAug 5, 2015
  3. Gaurav ChhabraAug 10, 2015
  4. Jacob KellerAug 10, 2015
  5. Eric SunshineAug 10, 2015
  6. Gaurav ChhabraAug 11, 2015

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.