Skip to content

Tabsize and tab support with editorconfig inside branch not working #27413

Open
@tkuschel

Description

@tkuschel

Description

gitea version 1.20.4 (my installed version at git.kuschel.at)
gitea version 1.22.0+dev-95-gcc5df2668 (try.gitea.io)

Reproduce the issue:

  1. Create a new repository, eg. "editorconfig"
  2. Create a test file with tabsize = 2 (spaces), i.e.
    indent_style = tab, and indent_size = 2.
  3. Commit this file to this repository (default branch),
    and push it to the gitea server.
  4. The uploaded file then resides in main (or master) branch.
  5. Create a new branch e.g. "issue" with "git checkout -b issue"
  6. Now on the branch issue, create the file .editorconfig
# Top-most EditorConfig file
root = true
[*]
indent_style = tab
indent_size = 2
end_of_file = lf
charset = UTF-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
  1. Commit and push this file to the gitea server.

Expected: View of the test_tab2 file (tabsize=2).
Received: The standard view of the gitea server, i.e.
version 1.20.4: tabsize=8
version 1.22.0-dev: tabsize=4 since #26391

  1. This issue also happens with other tab sizes.

Links for testing:

Hint: Changing the default branch to branch "issue"
recognizes the .editorconfig file!
So I think the .editorconfig file is only recognized at the default branch.

Interesting references about this topic: #26391 #24991

I would like to have a configuration option via the GUI that
can be set for the entire repository: indent style, and
indent size, similar to the .editorconfig, but without those conflicts
and knowledgement about the usage of .editorconfig

Gitea Version

1.22.0+dev-95-gcc5df2668 , 1.20.4

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Database

MySQL/MariaDB

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions