Re: git log --author=me

2015-11-03 Thread Michael J Gruber
Duy Nguyen venit, vidit, dixit 02.11.2015 19:37:
> On Mon, Nov 2, 2015 at 2:27 PM, Harry Jeffery <ha...@exec64.co.uk> wrote:
>> Hi,
>>
>> I've written a patch that allows `me` to be used as shorthand for
>> $(user.name) or $(user.email) in the `--author` and `--commiter` fields.
>>
>> The purpose being to make finding your own commits quicker and easier:
>> git log --author=me
>>
> 
> It would be even cooler if it accepts mail aliases, then you can
> define "me" to your address and also have shortcuts to a few of your
> best friends. Though as Andreas pointed out --author is not a good fit
> because it accepts regex, and you can't use --mine either, so more
> work..
> 

Alternatively: How about teaching git-completion to complete the
argument to --author? Expensive, I know, but faster than typing it out
or realising "Michael J" is not as unique as you think ;)

Michael
--
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: git log --author=me

2015-11-03 Thread Junio C Hamano
Michael J Gruber <g...@drmicha.warpmail.net> writes:

> Alternatively: How about teaching git-completion to complete the
> argument to --author? Expensive, I know, but faster than typing it out
> or realising "Michael J" is not as unique as you think ;)

Or

    $ git log --author="$me"

with

me='Michael J Gruber <g...@drmicha.warpmail.net>'

in your $HOME/.profile or somewhere?

I personally would find "--author=me" not so bad (especially if
finding _my_ work were a very important workflow element), and I may
even tell people to do

$ git log --author='[m]e'

if they want to find anybody with substring 'me' in their ident.

But that is only if it weren't for existing users, and we live in an
imperfect world where we seem to have many of existing users
already.

--
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


git log --author=me

2015-11-02 Thread Harry Jeffery

Hi,

I've written a patch that allows `me` to be used as shorthand for 
$(user.name) or $(user.email) in the `--author` and `--commiter` fields.


The purpose being to make finding your own commits quicker and easier:
git log --author=me

Is this a change that would be accepted if submitted? The only thing 
it's currently missing is unit tests.


Regards,
Harry
--
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: git log --author=me

2015-11-02 Thread Junio C Hamano
Andreas Schwab <sch...@linux-m68k.org> writes:

> Harry Jeffery <ha...@exec64.co.uk> writes:
>
>> The purpose being to make finding your own commits quicker and easier:
>> git log --author=me
>
> Since --author does a regexp search, this would most likely break
> someone's searches.  Better add a new option for that functionality.

I do not think it would hurt too much to add "--mine" to look for
"--author" that matches you, but on the other hand, I am not sure
its value outweighs the additional noise in the manual page.

It certainly does not help "I have done this much to this project in
the time period, and you can look at the output of this command
yourself to verify my claim.  Type 'git shortlog --mine' and then
promote me this season, please!" use case ;-)

So...
--
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: git log --author=me

2015-11-02 Thread Duy Nguyen
On Mon, Nov 2, 2015 at 2:27 PM, Harry Jeffery <ha...@exec64.co.uk> wrote:
> Hi,
>
> I've written a patch that allows `me` to be used as shorthand for
> $(user.name) or $(user.email) in the `--author` and `--commiter` fields.
>
> The purpose being to make finding your own commits quicker and easier:
> git log --author=me
>

It would be even cooler if it accepts mail aliases, then you can
define "me" to your address and also have shortcuts to a few of your
best friends. Though as Andreas pointed out --author is not a good fit
because it accepts regex, and you can't use --mine either, so more
work..
-- 
Duy
--
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: git log --author=me

2015-11-02 Thread Andreas Schwab
Harry Jeffery <ha...@exec64.co.uk> writes:

> The purpose being to make finding your own commits quicker and easier:
>     git log --author=me

Since --author does a regexp search, this would most likely break
someone's searches.  Better add a new option for that functionality.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
--
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: git log --author=me

2015-11-02 Thread Matthieu Moy
Junio C Hamano <gits...@pobox.com> writes:

> Andreas Schwab <sch...@linux-m68k.org> writes:
>
>> Harry Jeffery <ha...@exec64.co.uk> writes:
>>
>>> The purpose being to make finding your own commits quicker and easier:
>>> git log --author=me
>>
>> Since --author does a regexp search, this would most likely break
>> someone's searches.  Better add a new option for that functionality.
>
> I do not think it would hurt too much to add "--mine" to look for
> "--author" that matches you, but on the other hand, I am not sure
> its value outweighs the additional noise in the manual page.

I have a few aliases to congratulate myself for being such an awesome
contributor from time to time ;-):

[alias]
mymaster = log --oneline --author=matthieu@imag.fr origin/master

It did require me to write these lines in my config file, but I think
that the trouble of writing them is smaller than the extra noise in the
manual page and possibly the output of `git log -h`. Having the
shorthand "--author=me" would be better than "git log --mine" as far as
cluttering the doc is concerned IMHO, but it's also likely to break
someone's search.

BTW, the output of `git log -h` is disappointing:

$ git log -h
usage: git log [] [] [[--] ...]
   or: git show [] ...

-q, --quiet   suppress diff output
--source  show source
--use-mailmap Use mail map file
--decorate[=...]  decorate options
-L <n,m:file> Process line range n,m in file, counting from 1

There are far more options than this...

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
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