From: Andres Perera <andres.p@zoho.com>
To: Sitaram Chamarty <sitaramc@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
Duy Nguyen <pclouds@gmail.com>, David Jeske <davidj@gmail.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: ephemeral-branches instead of detached-head?
Date: Wed, 14 Aug 2013 12:10:49 -0430 [thread overview]
Message-ID: <CAPrKj1acdFGqkpzSANq_jUst_994e0sFFq+m4Q3wa7qT81uV5A@mail.gmail.com> (raw)
In-Reply-To: <520B486D.1040602@gmail.com>
On Wed, Aug 14, 2013 at 4:35 AM, Sitaram Chamarty <sitaramc@gmail.com> wrote:
> On 08/14/2013 12:40 PM, Andres Perera wrote:
>> On Wed, Aug 14, 2013 at 2:02 AM, Sitaram Chamarty <sitaramc@gmail.com> wrote:
>>> On 08/14/2013 07:14 AM, Junio C Hamano wrote:
>>>> Sitaram Chamarty <sitaramc@gmail.com> writes:
>>>>
>>>>> # all reflog entries that are not on a branch, tag, or remote
>>>>> d1 = !gitk --date-order $(git log -g --pretty=%H) --not --branches --tags --remotes
>>>>> # all dangling commits not on a branch, tag, or remote
>>>>> d2 = !gitk --date-order $(git fsck | grep "dangling.commit" | cut -f3 -d' ') --not --branches --tags --remotes
>>>>>
>>>>> (Apologies if something like this was already said; I was not following
>>>>> the discussion closely enough to notice)
>>>>
>>>> Yup.
>>>>
>>>> A potential problem is that the output from "log -g --pretty=%H" or
>>>> "fsck | grep dangling" may turn out to be humongous. Other than
>>>> that, they correctly compute what you want.
>>>
>>> I thought I mentioned that but I can't find my email now so maybe I
>>> didn't.
>>>
>>> In practice though, I find that, bash at least seems happy to take
>>> command lines as long as 7+ million characters long, so with the default
>>> reflog expire times, that should work out to 10,000 commits *per day*.
>>> [Tested with: echo {1000000..1900000} > junk; echo `cat junk` | wc]
>>
>> echo is a builtin in bash, as is the case with other shell implementations
>>
>> builtins may have different limit's than exec()'s ARG_MAX
>>
>> $ getconf ARG_MAX
>> 262144
>> $ perl -e 'print "A" x (262144 * 2)' | wc -c
>> 524288
>> $ perl -e 'print "A" x (262144 * 2)' | sh -c 'read v; echo "$v"' | wc -c
>> 524289
>> $ perl -e 'print "A" x (262144 * 2)' | sh -c 'read v; /bin/echo "$v"' | wc -c
>> sh: /bin/echo: Argument list too long
>> 0
>>
>> builtin's argument buffer limit tends to be aligned with the
>> implementation's lexer buffer limit
>
> Aah; good catch -- I did not know this. Thanks!
>
> My systems show 2621440 on CentOS 6 and 2097152 on Fedora 19, so --
> dividing by 8 (abbrev SHA + space) then by 90, that's still 2900 commits
> *per day* to run past this limit though!
ARG_MAX may also include the process environment, which needs to be
copied over to the new vm
the limit may also include the argv pointer sizes
those calculations based on SHA string length are just approximates
>
> (side note: making a single argument that long seems to have a much
> lower limit than having multiple arguments:
>
> $ /bin/echo `perl -e 'print "A" x (1000000)'` | wc
> -bash: /bin/echo: Argument list too long
> 0 0 0
> $ /bin/echo `perl -e 'print "A " x (1000000)'` | wc
> 1 1000000 2000000
>
> notice that the second one is twice as long in terms of bytes, but it's
> not a single argument).
the behaviour is different in OpenBSD-amd64:
perl -e 'print "A " x ((262144/2)-5)' | env -i sh -c 'unset PATH; read
v; /bin/echo $v' | wc -c
a bigger size and i get E2BIG. if i pass the env or let PATH get
exported, again, i need to reduce the multiplier
apparently Linux is doing copyin() for each argument. that seems
excessive to me :)
prev parent reply other threads:[~2013-08-14 16:40 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-12 7:25 ephemeral-branches instead of detached-head? David Jeske
2013-08-12 7:39 ` Jonathan Nieder
2013-08-12 7:55 ` Junio C Hamano
2013-08-12 8:37 ` David Jeske
2013-08-12 12:14 ` David Jeske
2013-08-12 13:23 ` Duy Nguyen
2013-08-12 17:04 ` Andreas Schwab
2013-08-12 17:24 ` Junio C Hamano
2013-08-12 19:40 ` David Jeske
2013-08-12 19:05 ` David Jeske
2013-08-12 17:22 ` Junio C Hamano
2013-08-13 6:05 ` Duy Nguyen
[not found] ` <CA+CP9O5Ak3YD60--Mj+eLv3qzbZuuwTN-AxY3xb=SciKD=uZoQ@mail.gmail.com>
2013-08-13 15:13 ` Duy Nguyen
2013-08-13 15:36 ` Fwd: " David Jeske
2013-08-13 16:58 ` Junio C Hamano
2013-08-13 17:13 ` Junio C Hamano
2013-08-13 16:49 ` Junio C Hamano
2013-08-14 0:04 ` Sitaram Chamarty
2013-08-14 1:44 ` Junio C Hamano
2013-08-14 6:32 ` Sitaram Chamarty
2013-08-14 6:59 ` Jeff King
2013-08-14 7:10 ` Andres Perera
2013-08-14 9:05 ` Sitaram Chamarty
2013-08-14 16:40 ` Andres Perera [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPrKj1acdFGqkpzSANq_jUst_994e0sFFq+m4Q3wa7qT81uV5A@mail.gmail.com \
--to=andres.p@zoho.com \
--cc=davidj@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pclouds@gmail.com \
--cc=sitaramc@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).