Skip to content

🐛 submodules SHA are truncated to a too small value #1408

@matttbe

Description

@matttbe

Hello,

First, thank you for this very nice project, it really improves many git commands output!

I recently noticed that when a submodule is modified, the 'diff' shows truncated SHA, e.g.

Δ kernelspace
1234567..7654321

Limiting the output to 7 chars is an issue with repos having a lot of commits (e.g. the Linux kernel) and you can get errors like this one if you are unlucky:

error: short object ID 1234567 is ambiguous
hint: The candidates are:
hint:   1234567xxxxxx commit (...)
hint:   1234567yyyyyy tree

It looks like the limitation to 7 chars is hardcoded:

self.config
.minus_style
.paint(minus_commit.chars().take(7).collect::<String>()),
self.config
.plus_style
.paint(commit.chars().take(7).collect::<String>()),

Could it be possible to make this number configurable?
Or showing more chars by default? For the Linux kernel, they recommend to use min 12 digits (but this number might increase in the future)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions