On Monday, December 6, 2021 at 9:34:52 AM UTC+1 Konstantin Khomoutov wrote:

> On Sun, Dec 05, 2021 at 09:03:53AM -0800, Philip Oakley wrote: 
>
> > Set up different 'username' on the two machines (or committer / author 
> > difference, etc). 
>
> [...] 
>
> ...also do not forget that it's OK to insert into a commit message any 
> number 
> of "machine-readable" fields such as 
>
> Machine: whatever-machine 
>
> Just make sure such stuff is placed after the initial (terse) message 
> and a blank line. Usually such key/value parts go last so that the whole 
> message looks like 
>
> A terse commit message 
>
> An long explanatory 
> commit message. 
>
> Keyword1: Value1 
> Keyword2: Value2 
>
> Such K/V options can then be parsed when needed. 
>
> Note that you can make Git use custom template for your commit message 
> with a 
> pre-created keyword through the "commit.template" configuration option. 
>
>
I assume the git operations below are kept ? this is not explained properly 
in following tutorial:

Create A Custom Git Commit Template | by Alex Wasik | Medium 
<https://alex-wasik.medium.com/create-a-custom-git-commit-template-84468232a459>

git config --global commit.template ~/.gitmessage

Also what is ment with ~/. ? Where is this folder located ? At root of any 
repository ?

So this would allow me to setup a gitmessage per repository ?

Or is this folder located somewhere in git distribution ?

If it's per repositoy then this is again not proper, and faulty. It says 
global.

So now more guess work for me.

I would like to setup git commit message such that:

1. It's true global no matter what repository I use.
2. I would like to keep this gitmessage with the mintty or git thing I am 
using.

I see a danger here though, if I switch to a different version I may loose 
this functionality and might not notice it after a while but ok.

3. I do not want to loose standard text such as:

Oh I can't even display it anymore, I was afraid of this, didn't want to 
set it yet, but finally decided to give it a try, but it did clearify 
something:
$ git commit
fatal: could not read 'C:/Users/Skybuck/.gitmessage': No such file or 
directory

So a shocking discovery is made, if this setting is wrong, git completely 
breaks, some might like it, some might not... not very robust is it this 
git, but at least it's clear that something is screwed up...

It's also surprising that git seems ~/. as that user folder... quite 
strange and very insenstive of git... I am not even working on C:  I have 
been working on E: all this time... at least mostly ! ;) ok git was 
installed on C: but so what... the os is there... but so what... I don't 
like it in general if apps integrate them selfes with some whacky operating 
system.

If git had chosen it's installation directory as it's home directory I 
would have been perfectly fine with that.... but I 100% dislike window user 
folders it sucks ass.... lot's of junk in there... easy to get stuff lost 
in there.

Also easy to forget that anything was stored in there of importance.  For 
that reason I don't like this solution.

I will try and give it a more absolute path and see if that works:

I'm thinking of something along the lines of :

C:\Tools\Git\CommitMessage\

or maybe
C:\Tools\Git\CustomUserSettings\CommitMessage

Yeah that last one gonna be the one.

Now first I try and reset this so I can show what I ment with other 
standard messages:

I tried to reset with:

$ git config --global commit.template 

Didn't work ofcourse shows current wrong setting.

then I tried:
$ git config --global commit.template ""

That didn't work either which again is kinda shocking ?!

How do I get rid of this faulty setting ? see below:

git config --global --unset commit.template

I would like to keep this below my own template:

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch AddThreadInfo
# Changes to be committed:
#       new file:   src/gui-classic/Frames/UFrameThreadInfo.dfm
#       new file:   src/gui-classic/Frames/UFrameThreadInfo.pas
#

Anyway I am getting a lot of copy & paste failures caused by two things:

1. Buggy left mouse
2. Sometimes git bash malfunctions and does not paste the new copied text, 
this is a very dangerous thing. I ended up pasting an entire log from git 
stash thread/message... I was lucky there... git bash is buggy and should 
be fixed or some save guards build in...

Especially reacting to enter commands, new lines and such, git bash should 
make it impossible to execute commands that were pasted... as a safety 
precaution... an option added to git bash to prevent accidental execution 
of commands would highly be appreciated, perhaps such an option already 
exists ?!?

Anyway I will give my path suggestion above a try and report on it later.

Also why the pattern:

Key:Value

is
Key=Value

also possible ?

Or anything else ?

Or is there some standard software that can only process key:value and not 
key=value ???

Bye for now,
  Skybuck.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/29047494-fb9e-4d22-8113-5bcefab30ee7n%40googlegroups.com.

Reply via email to