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

Re: [PATCH 1/4] Extract some utilities from git-svn to allow extracting Git::SVN.

From
Michael G Schwern <schwern@pobox.com>
Date
Jul 26, 2012, 00:01 UTC
Message-ID
<501088EC.50405@pobox.com>
In-Reply-To
<20120725230833.GA23993@dcvr.yhbt.net>

This is rapidly getting into the weeds. Regardless of the debate below, what would you like me to do? Switch indentation to tabs and resubmit? AFAIK only the new tests are affected.

On 2012.7.25 4:08 PM, Eric Wong wrote:
Show 21 quoted lines
>>>> +BEGIN {
>>>> +    # Override exit at BEGIN time before Git::SVN::Utils is loaded
>>>> +    # so it will see our local exit later.
>>>> +    *CORE::GLOBAL::exit = sub(;$) {
>>>> +        return @_ ? CORE::exit($_[0]) : CORE::exit();
>>>> +    };
>>>> +}
>>>
>>> For new code related to git-svn, please match the existing indentation
>>> style (tabs) prevalent in git-svn.  Most of the Perl found in git also
>>> uses tabs for indentation.
>>
>> About that.  I followed kernel style in existing code, but felt that new code
>> would do better to follow Perl style.  The existing Perl code mixes tabs and
>> spaces, so I felt it wasn't a strongly held style.  You'll get more Perl
>> programmers to work on the Perl code by following Perl style in the Perl code
>> rather than kernel style.
> 
> git-svn should be all tabs (though some spaces accidentally slipped in
> over the years).  git maintainers are mostly C programmers used to tabs,
> so non-C code should favor their expectations.
Perhaps this is self fulfilling.  Would you like to attract more Perl programmers?
> I also favor tabs since they're more space-efficient and leads to faster
> "git grep" on large source trees (more important for bigger projects).
> I remember many years ago "git grep" was shown to be ~20% faster on
> a source tree with tabs.
Storage costs a dime a gig.  One extra music file negates your space savings.
 I have more CPU power on my phone than I had on my desktop "many years ago".
 It doesn't matter if tabs make git-grep 20% faster because it's going to be
200ms vs 240ms.

Regardless, you don't choose your coding style because it's easier for the computer. You choose it because it makes the code easier for humans to work with.

Show 11 quoted lines
> (I'm neither a kernel hacker nor a regular Perl hacker)
> 
>> Alternatively, how about allowing emacs/vim configuration comments?  The
>> Kernel coding style doesn't allow them, how do you folks feel?  Then people
>> don't have to guess the style and reconfigure their editor, their editor will
>> do it for them.
> 
> I don't like them, and I think others here frowns upon them, too.  They
> take too much space and shows favor/preference towards certain editors.
> It'll be a bigger problem if more editors become popular and we start
> "supporting" them.

What you say above is correct, but the extra space is not wasted. It would be like complaining about all the space that Documentation takes up, and that it shows preference towards English. Its *useful* to somebody not already using your style. It's useful for new-to-your-project folks. It's also useful for somebody switching between the C and Perl code (though a good editor should already be set up to do C and Perl differently).

Are the editor wars still going on here? Is somebody going to be *offended* if their editor isn't represented? If so, shouldn't they grow up?

Show 6 quoted lines
>> The important thing is to have one less special thing a new-to-your-project
>> Perl programmer has to do.
> 
> Historically git development has catered to C programmers used to tabs.
> I think the mixing of indentation styles in current Perl files is the
> most confusing.

I agree that mixing the style within the Perl code isn't good. Perl code can very quickly be reformatted. A basic perltidy config can help keep it that way.

-- 
Alligator sandwich, and make it snappy!
Previous: Eric WongNext: Eric Wong
Message 6 of 12 in “Move Git::SVN into its own .pm file”
  1. Michael G. SchwernJul 25, 2012
  2. 1/4 Extract some utilities from git-svn to allow extracting Git::SVN.Michael G. Schwern, Jul 25, 2012
  3. Eric WongJul 25, 2012
  4. Michael G SchwernJul 25, 2012
  5. Eric WongJul 25, 2012
  6. Michael G SchwernJul 26, 2012
  7. Eric WongJul 26, 2012
  8. Jonathan NiederJul 26, 2012
  9. 2/4 Prepare Git::SVN for extraction into its own file.Michael G. Schwern, Jul 25, 2012
  10. 4/4 Move initialization of Git::SVN variables into Git::SVN.Michael G. Schwern, Jul 25, 2012
  11. Jonathan NiederJul 25, 2012
  12. Michael G SchwernJul 25, 2012

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.