Re: Reference to a commit inside a commit message

2014-04-30 Thread Vincenzo di Cicco
> You should use the latest version of the patch series (v11), because the
> blank line is now automatically added.

Yes interpret-trailers add the blank line, but when call `git commit
-m "$MSG" -e` it isn't displayed.
I think this happens due to the default value of 'cleanup' option of
git-commit that is 'strip' (in my case) when the message is edited.
I can't use neither 'verbatim' nor 'whitespace' otherwise all the
comments will be displayed.

> And using ':' instead of '=' after "see-also" would be more standard.

Thanks I've updated my script and now I'm using the latest interpret-trailers.

NaN
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Reference to a commit inside a commit message

2014-04-29 Thread Vincenzo di Cicco
Thanks to all.
With interpret-trailers has been easy to make a simple script, also it
checks if the Hash passed is a valid Object.
I haven't found a simple way to mantain the blank line above the
output of interpet-trailers (not even through cleanup).
Follows the script, maybe could be usefull for somebody:

#!/bin/sh
for i in $*
do
git show $i &> /dev/null
if [ $? = 0 ]
then
trailers+=" see-also=$i"
fi
done

msg=$(cat /dev/null | ../git-interpret-trailers $trailers)

git commit -m "$msg" -e
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Reference to a commit inside a commit message

2014-04-29 Thread Felipe Contreras
Jeff King wrote:

> [1] I do not know about others, but I typically cut and paste from
> another terminal, and use the following alias in my config:
> 
>   [alias]
>   ll = "!git --no-pager log -1 --pretty='tformat:%h (%s, %ad)' 
> --date=short"

I have:

  [alias]
  short = show --quiet --format='%C(auto)%h (%s)%C(reset)'

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Reference to a commit inside a commit message

2014-04-28 Thread Jeff King
On Mon, Apr 28, 2014 at 08:35:52PM +0200, enzodici...@gmail.com wrote:

> For example, thinking about it, I've imagined to add this feature to `git 
> commit`:
> 
> git commit --see-also   ...

Jonathan mentioned already that we typically just do this by hand[1],
though look on the list for the "interpret-trailers" work being done by
Christian. It would make it very easy to add:

  See-also: 

lines to the bottom of your commit using a command like the above. I
don't know if it would be easy to convert refnames into commit ids with
it or not. You'd have to look.

-Peff

[1] I do not know about others, but I typically cut and paste from
another terminal, and use the following alias in my config:

  [alias]
  ll = "!git --no-pager log -1 --pretty='tformat:%h (%s, %ad)' --date=short"
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Reference to a commit inside a commit message

2014-04-28 Thread Vincenzo di Cicco
Thank you very much

> Why not?

the reason is to avoid mistakes with the hash. An automatic approach
can verify the existence of the commit.

> See the output of
>
> git log --grep='In commit '
>
> and
>
> git log --grep='In v'

I've just tried the commands and noticed that this can be a common practice.
This increases my curiosity to know if there is a better way to handle
this situation, if you know other thread where was discussed, please
tell me the link.

Thanks,
NaN
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Reference to a commit inside a commit message

2014-04-28 Thread Jonathan Nieder
Hi,

enzodici...@gmail.com wrote:

> Hi to all, I'm trying to figure out what is the best way (and if it
> exists) to link a message of a commit to another commit.
[...]
> Obviously I don't mean to put the raw Hash,

Why not?

See the output of

git log --grep='In commit '

and

git log --grep='In v'

in git.git or linux.git for some examples of current practice.

Curious,
Jonathan
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html