Skip to content

Fix/encoding#2230

Open
malon7782 wants to merge 4 commits intogit:masterfrom
malon7782:fix/encoding
Open

Fix/encoding#2230
malon7782 wants to merge 4 commits intogit:masterfrom
malon7782:fix/encoding

Conversation

@malon7782
Copy link
Contributor

No description provided.

To pave the way for reducing the global state tied to commit encoding
in a subsequent patch, functions like 'commit_tree()' and
'commit_tree_extended()' must be able to access a repository instance.

Plumb the 'struct repository' pointer down the call chain for these
APIs. For built-ins or subsystems already dependent on global state
(e.g., 'notes_cache_write()'), fallback to 'the_repository'.

No functional changes are introduced in this preparatory step.

Signed-off-by: Tian Yuchen <a3205153416@gmail.com>
To prepare for the elimination of the global state associated with
'log_output_encoding', functions responsible for formatting commit
messages, such as 'pretty_print_commit()' and 'pp_commit_easy()',
must be able to access a repository instance.

Plumb the 'struct repository' pointer down the call chain for these
APIs. Where no such context is readily available in built-ins or
high-level functions, fallback to 'the_repository'.

Signed-off-by: Tian Yuchen <a3205153416@gmail.com>
The global variables 'git_commit_encoding' and 'git_log_output_encoding'
prevent libification.

Migrate these variables into 'struct repository'. Note that these variables
are not migrated to 'repo_settings'. As user preferences, they must be parsed
eagerly to maintain immediate UX feedback.

While the core read and write APIs (updated in previous patches) now
utilize the 'struct repository' pointer, the config parsing step
('git_default_i18n_config') currently parses these values into
'the_repository', since safely plumbing a repository pointer through
the 'git_default_config' callback machinery is highly invasive due to
the diverse and custom structures currently passed via the 'void *cb'
parameter.

Signed-off-by: Tian Yuchen <a3205153416@gmail.com>
@gitgitgadget-git
Copy link

There is an issue in commit 196b272:
environment: migrate encoding configs to struct repository

  • Lines in the body of the commit messages should be wrapped between 60 and 76 characters.
    Indented lines, and lines without whitespace, are exempt

@gitgitgadget-git
Copy link

There is a merge commit in this Pull Request:

349061a52a66ec06e9bf070e6d6cd5e962c6e2c7

Please rebase the branch and force-push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant