All of lore.kernel.org
 help / color / mirror / Atom feed
* minimum commit id length when fixing a patch
@ 2017-06-06 20:34 Kevin Wilson
  2017-06-06 20:55 ` Leo Silva (a.k.a kirotawa)
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Kevin Wilson @ 2017-06-06 20:34 UTC (permalink / raw)
  To: kernelnewbies

Hi,
I want to send a patch to LKML fixing something wrong which was caused
by other patch.

Form what I understand, it is a good practice to mention the commit
title and the commit ID.

A commit ID is very long. My question is: when mentioning in my commit
log the patch that caused the problem, what is the minimum commit id
length which I should use when presenting the patch that caused the
problem ? is such commit length is documented anywhere ?

Regards,
Kevin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* minimum commit id length when fixing a patch
  2017-06-06 20:34 minimum commit id length when fixing a patch Kevin Wilson
@ 2017-06-06 20:55 ` Leo Silva (a.k.a kirotawa)
  2017-06-06 20:57 ` Bjørn Mork
  2017-06-06 21:03 ` Igor Pylypiv
  2 siblings, 0 replies; 8+ messages in thread
From: Leo Silva (a.k.a kirotawa) @ 2017-06-06 20:55 UTC (permalink / raw)
  To: kernelnewbies

If you run git log --oneline, you will see a sha ID of this size: a83727c,
by example. So, I think it's the minimum you can use.

[]'s

On Tue, Jun 6, 2017 at 5:34 PM, Kevin Wilson <wkevils@gmail.com> wrote:

> Hi,
> I want to send a patch to LKML fixing something wrong which was caused
> by other patch.
>
> Form what I understand, it is a good practice to mention the commit
> title and the commit ID.
>
> A commit ID is very long. My question is: when mentioning in my commit
> log the patch that caused the problem, what is the minimum commit id
> length which I should use when presenting the patch that caused the
> problem ? is such commit length is documented anywhere ?
>
> Regards,
> Kevin
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 

----------------------------------------------
Le?nidas S. Barbosa (Kirotawa)
blog: corecode.wordpress.com

""O que importa s?o os incont?veis pequenos atos de pessoas desconhecidas,
que fundam as bases para os eventos significativos que se tornam hist?ria"
- Howard Zinn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20170606/508cf7c3/attachment.html 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* minimum commit id length when fixing a patch
  2017-06-06 20:34 minimum commit id length when fixing a patch Kevin Wilson
  2017-06-06 20:55 ` Leo Silva (a.k.a kirotawa)
@ 2017-06-06 20:57 ` Bjørn Mork
  2017-06-08 10:29   ` Kevin Wilson
  2017-06-06 21:03 ` Igor Pylypiv
  2 siblings, 1 reply; 8+ messages in thread
From: Bjørn Mork @ 2017-06-06 20:57 UTC (permalink / raw)
  To: kernelnewbies

Kevin Wilson <wkevils@gmail.com> writes:

> Hi,
> I want to send a patch to LKML fixing something wrong which was caused
> by other patch.
>
> Form what I understand, it is a good practice to mention the commit
> title and the commit ID.
>
> A commit ID is very long. My question is: when mentioning in my commit
> log the patch that caused the problem, what is the minimum commit id
> length which I should use when presenting the patch that caused the
> problem ? is such commit length is documented anywhere ?

12

It's mentioned here and there.  One place is the .git/config example in
section "2) Describe your changes" in
Documentation/process/submitting-patches.rst :


 The following ``git config`` settings can be used to add a pretty format for
 outputting the above style in the ``git log`` or ``git show`` commands::
 
         [core]
                 abbrev = 12
         [pretty]
                 fixes = Fixes: %h (\"%s\")


(BTW, using the "Fixes" tag might be appropriate for your patch)


Or see for example:
https://public-inbox.org/git/CA+55aFy0_pwtFOYS1Tmnxipw9ZkRNCQHmoYyegO00pjMiZQfbg at mail.gmail.com/


Bj?rn

^ permalink raw reply	[flat|nested] 8+ messages in thread

* minimum commit id length when fixing a patch
  2017-06-06 20:34 minimum commit id length when fixing a patch Kevin Wilson
  2017-06-06 20:55 ` Leo Silva (a.k.a kirotawa)
  2017-06-06 20:57 ` Bjørn Mork
@ 2017-06-06 21:03 ` Igor Pylypiv
  2 siblings, 0 replies; 8+ messages in thread
From: Igor Pylypiv @ 2017-06-06 21:03 UTC (permalink / raw)
  To: kernelnewbies

If your patch fixes a bug in a specific commit, e.g. you found an
issue using git bisect,
please use the ?Fixes:? tag with the first 12 characters of the SHA-1
ID, and the one line summary.
For example:

Fixes: e21d2170f366 ("video: remove unnecessary platform_set_drvdata()")

Quote from: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes

Example from github:
https://github.com/torvalds/linux/commit/5f348fa35a28b19cf7ee1eaa420757341a724c86

On Tue, Jun 6, 2017 at 1:34 PM, Kevin Wilson <wkevils@gmail.com> wrote:
> Hi,
> I want to send a patch to LKML fixing something wrong which was caused
> by other patch.
>
> Form what I understand, it is a good practice to mention the commit
> title and the commit ID.
>
> A commit ID is very long. My question is: when mentioning in my commit
> log the patch that caused the problem, what is the minimum commit id
> length which I should use when presenting the patch that caused the
> problem ? is such commit length is documented anywhere ?
>
> Regards,
> Kevin
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 8+ messages in thread

* minimum commit id length when fixing a patch
  2017-06-06 20:57 ` Bjørn Mork
@ 2017-06-08 10:29   ` Kevin Wilson
  2017-06-08 10:46     ` Bjørn Mork
  0 siblings, 1 reply; 8+ messages in thread
From: Kevin Wilson @ 2017-06-08 10:29 UTC (permalink / raw)
  To: kernelnewbies

Thanks, Bjorn.

I added in /root/.gitconfig
...
[core]
        abbrev = 12
[pretty]
        fixes = Fixes: %h (\"%s\")
...

Still, "git log" shows more than 12 digits, like:
commit 0a528ee9a52007984fa60b0c4ef1f39fdf5edf8d
Author: Tariq Toukan <tariqt@mellanox.com>
Date:   Wed Jun 7 16:26:15 2017 +0300

    IB/mlx4: Bump driver version

Does it work for you ?

Regards,
Kevin



On Tue, Jun 6, 2017 at 11:57 PM, Bj?rn Mork <bjorn@mork.no> wrote:
> Kevin Wilson <wkevils@gmail.com> writes:
>
>> Hi,
>> I want to send a patch to LKML fixing something wrong which was caused
>> by other patch.
>>
>> Form what I understand, it is a good practice to mention the commit
>> title and the commit ID.
>>
>> A commit ID is very long. My question is: when mentioning in my commit
>> log the patch that caused the problem, what is the minimum commit id
>> length which I should use when presenting the patch that caused the
>> problem ? is such commit length is documented anywhere ?
>
> 12
>
> It's mentioned here and there.  One place is the .git/config example in
> section "2) Describe your changes" in
> Documentation/process/submitting-patches.rst :
>
>
>  The following ``git config`` settings can be used to add a pretty format for
>  outputting the above style in the ``git log`` or ``git show`` commands::
>
>          [core]
>                  abbrev = 12
>          [pretty]
>                  fixes = Fixes: %h (\"%s\")
>
>
> (BTW, using the "Fixes" tag might be appropriate for your patch)
>
>
> Or see for example:
> https://public-inbox.org/git/CA+55aFy0_pwtFOYS1Tmnxipw9ZkRNCQHmoYyegO00pjMiZQfbg at mail.gmail.com/
>
>
> Bj?rn
>
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* minimum commit id length when fixing a patch
  2017-06-08 10:29   ` Kevin Wilson
@ 2017-06-08 10:46     ` Bjørn Mork
  2017-06-08 11:58       ` Kevin Wilson
  0 siblings, 1 reply; 8+ messages in thread
From: Bjørn Mork @ 2017-06-08 10:46 UTC (permalink / raw)
  To: kernelnewbies

Kevin Wilson <wkevils@gmail.com> writes:

> Thanks, Bjorn.
>
> I added in /root/.gitconfig
> ...
> [core]
>         abbrev = 12
> [pretty]
>         fixes = Fixes: %h (\"%s\")
> ...
>
> Still, "git log" shows more than 12 digits, like:
> commit 0a528ee9a52007984fa60b0c4ef1f39fdf5edf8d
> Author: Tariq Toukan <tariqt@mellanox.com>
> Date:   Wed Jun 7 16:26:15 2017 +0300
>
>     IB/mlx4: Bump driver version
>
> Does it work for you ?


See the section on "Commit Formatting" in git-log(1).  The config only
changes the abbreviated id, while the default log format use the full
id.  You can do "git log --abbrev-commit", or set "log.abbrevCommit" to
change this default.

Personally I prefer having the full id in the "normal" git log, but like
to use the abbreviated id in fixes tags and other one-line references to
commits.  This is done by using %h instead of %H in the format specifier.



Bj?rn

^ permalink raw reply	[flat|nested] 8+ messages in thread

* minimum commit id length when fixing a patch
  2017-06-08 10:46     ` Bjørn Mork
@ 2017-06-08 11:58       ` Kevin Wilson
  2017-06-08 12:31         ` Bjørn Mork
  0 siblings, 1 reply; 8+ messages in thread
From: Kevin Wilson @ 2017-06-08 11:58 UTC (permalink / raw)
  To: kernelnewbies

Hi Bjorn,
Indeed "git config --global log.abbrevCommit true" did the job, afterwards
"git log" shows 12 digits hash.

>Personally I prefer having the full id in the "normal" git log
May I ask, out of interest,  why ? according to my understanding, the
12 digits ID should show a unique patch (at least for kernel git
trees, which is primarily where I use it)


Regards,
Kevin


On Thu, Jun 8, 2017 at 1:46 PM, Bj?rn Mork <bjorn@mork.no> wrote:
> Kevin Wilson <wkevils@gmail.com> writes:
>
>> Thanks, Bjorn.
>>
>> I added in /root/.gitconfig
>> ...
>> [core]
>>         abbrev = 12
>> [pretty]
>>         fixes = Fixes: %h (\"%s\")
>> ...
>>
>> Still, "git log" shows more than 12 digits, like:
>> commit 0a528ee9a52007984fa60b0c4ef1f39fdf5edf8d
>> Author: Tariq Toukan <tariqt@mellanox.com>
>> Date:   Wed Jun 7 16:26:15 2017 +0300
>>
>>     IB/mlx4: Bump driver version
>>
>> Does it work for you ?
>
>
> See the section on "Commit Formatting" in git-log(1).  The config only
> changes the abbreviated id, while the default log format use the full
> id.  You can do "git log --abbrev-commit", or set "log.abbrevCommit" to
> change this default.
>
> Personally I prefer having the full id in the "normal" git log, but like
> to use the abbreviated id in fixes tags and other one-line references to
> commits.  This is done by using %h instead of %H in the format specifier.
>
>
>
> Bj?rn

^ permalink raw reply	[flat|nested] 8+ messages in thread

* minimum commit id length when fixing a patch
  2017-06-08 11:58       ` Kevin Wilson
@ 2017-06-08 12:31         ` Bjørn Mork
  0 siblings, 0 replies; 8+ messages in thread
From: Bjørn Mork @ 2017-06-08 12:31 UTC (permalink / raw)
  To: kernelnewbies

Kevin Wilson <wkevils@gmail.com> writes:

>>Personally I prefer having the full id in the "normal" git log
> May I ask, out of interest,  why ? according to my understanding, the
> 12 digits ID should show a unique patch (at least for kernel git
> trees, which is primarily where I use it)

Because I'm used to having the full id in the log, I guess. And it takes
up a line anyway, so there is nothing to save.  And I rarely/never copy
the id from a full log.  If I want to refer to the id, then I use some
formatting macro for that. Like the --pretty=fixes from the config
example,

But this is all subjective.  Whatever works for you is fine :-)


Bj?rn

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-06-08 12:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-06 20:34 minimum commit id length when fixing a patch Kevin Wilson
2017-06-06 20:55 ` Leo Silva (a.k.a kirotawa)
2017-06-06 20:57 ` Bjørn Mork
2017-06-08 10:29   ` Kevin Wilson
2017-06-08 10:46     ` Bjørn Mork
2017-06-08 11:58       ` Kevin Wilson
2017-06-08 12:31         ` Bjørn Mork
2017-06-06 21:03 ` Igor Pylypiv

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.