Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot load commit.template #1745

Closed
malleroid opened this issue Jul 5, 2023 · 9 comments · Fixed by #1801
Closed

cannot load commit.template #1745

malleroid opened this issue Jul 5, 2023 · 9 comments · Fixed by #1801
Labels
bug Something isn't working
Milestone

Comments

@malleroid
Copy link

Thanks for the great product!
I just started using it, but I'm reporting something I didn't quite understand.

I have commit.template set up and it is loaded when I run the git commit command from the shell.
However, when I try to edit the commit message by ^e when committing from gitui, it is not loaded.

I am aware that commit.template is supported, but is there something wrong with my configuration? (#546)

The first one is when you run git commit, and the second one is when you open the editor from gitui.

image image

The following is a description of the settings for git commit.template.

image image
  • OS: macOS Ventura 13.3
  • GitUI version: 0.23.0
@malleroid malleroid added the bug Something isn't working label Jul 5, 2023
@extrawurst
Copy link
Owner

have you tried if a complete path works? (not using ~)

@extrawurst
Copy link
Owner

if you can please build from source with 5246aab (on branch fix-1745-commit-template-problem) which will add more error logging around commit-template loading, to help diagnose this

@malleroid
Copy link
Author

Thanks for the reply!
Sorry for the delay in noticing your response.

I will try the information you provided!

@malleroid
Copy link
Author

@extrawurst
I was able to load and display it when I set it to an complete path! Thank you!!!! 😆
However I do have a request.
I'm using dotfiles to reuse information like .gitconfig across multiple machines, so it would be great if it could be loaded with relative paths as well.

I've tried using it after checking out the relevant branch locally and running cargo build.
And stop using Homebrew installed version.

However, I'm not very familiar with Rust, and I apologize, but I couldn't locate the log.
It looks like the setup_logging initializes the configuration using crates like log or simplelog, and I assumed that the output would be in a file called gitui.log.
Even when using the find command, I couldn't locate it.

Could you possibly advise where the output might be found?

Additionally, I want to express my appreciation for your support!

@extrawurst
Copy link
Owner

@malleroid
Copy link
Author

@extrawurst

Totally missed that. Thanks!
Here's the error part from the generated log.

06:48:18 [TRACE] (1) gitui::app: [src/app.rs:509] update_async: Git(Status)
06:48:18 [TRACE] (1) gitui::app: [src/app.rs:392] event: Input(Key(KeyEvent { code: Char('c'), modifiers: NONE, kind: Press, state: NONE }))
06:48:18 [ERROR] read commit.template failed: No such file or directory (os error 2)
06:48:21 [TRACE] (1) gitui::app: [src/app.rs:392] event: Input(Key(KeyEvent { code: Char('e'), modifiers: CONTROL, kind: Press, state: NONE }))
06:48:22 [INFO] input polling suspended
06:48:22 [TRACE] (1) gitui::app: [src/app.rs:392] event: State(Paused)
06:48:25 [INFO] input polling resumed

The result showed an error indicating that it couldn't detect the presence of the file.

Is there any other information you need from me?

@extrawurst
Copy link
Owner

if it could be loaded with relative paths as well.

it will work with relative paths. what it does not support right now is ~

@extrawurst extrawurst added this to the v0.24 milestone Aug 9, 2023
@extrawurst
Copy link
Owner

please try again to build from the branch and validate that a commit.template path including ~ works

@malleroid
Copy link
Author

@extrawurst
Thank you for your prompt response!! 😃

I built it locally and confirmed that I was able to load the commit_template just as you've modified! Great! 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants