Skip to content

Commit

Permalink
chore: rename option, add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
skywarth committed Oct 12, 2024
1 parent f848ea1 commit 36b2159
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions docs/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ export ENABLED_GIT_REVISION_DATE=false
mkdocs serve
```

## `enable_git_follow`

Default is `true`. When enabled it will issue `--follow` option for git history tracing; meaning it will also track file's previous history for rename and move operations.

When disabled (by setting it to `false`), each file's history will only consist of its current name and path, it's history from the previous paths or names will not be included.

When enabled (by setting it to `true`), history tracking with `--follow` will be enabled and history will include the file's history from rename and other paths.

## `strict`

Default is `true`. When enabled, the logs will show warnings when something is wrong but a fallback has been used. When disabled, the logger will use the INFO level instead.
Expand Down
2 changes: 1 addition & 1 deletion src/mkdocs_git_revision_date_localized_plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class GitRevisionDateLocalizedPlugin(BasePlugin):
("enable_creation_date", config_options.Type(bool, default=False)),
("enabled", config_options.Type(bool, default=True)),
("strict", config_options.Type(bool, default=True)),
("version_history_follow_enabled", config_options.Type(bool, default=True))
("enable_git_follow", config_options.Type(bool, default=True))
)

def on_config(self, config: config_options.Config, **kwargs) -> Dict[str, Any]:
Expand Down
2 changes: 1 addition & 1 deletion src/mkdocs_git_revision_date_localized_plugin/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def get_git_commit_timestamp(
realpath = os.path.realpath(path)
git = self._get_repo(realpath)

follow_option=self.config.get('version_history_follow_enabled')
follow_option=self.config.get('enable_git_follow')

if is_first_commit:
# diff_filter="A" will select the commit that created the file
Expand Down

0 comments on commit 36b2159

Please sign in to comment.