All of lore.kernel.org
 help / color / mirror / Atom feed
* git log --author=me
@ 2015-11-02 13:27 Harry Jeffery
  2015-11-02 17:50 ` Andreas Schwab
  2015-11-02 18:37 ` Duy Nguyen
  0 siblings, 2 replies; 7+ messages in thread
From: Harry Jeffery @ 2015-11-02 13:27 UTC (permalink / raw)
  To: git

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

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

* Re: git log --author=me
  2015-11-02 13:27 git log --author=me Harry Jeffery
@ 2015-11-02 17:50 ` Andreas Schwab
  2015-11-02 18:05   ` Junio C Hamano
  2015-11-02 18:37 ` Duy Nguyen
  1 sibling, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2015-11-02 17:50 UTC (permalink / raw)
  To: Harry Jeffery; +Cc: git

Harry Jeffery <harry@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, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: git log --author=me
  2015-11-02 17:50 ` Andreas Schwab
@ 2015-11-02 18:05   ` Junio C Hamano
  2015-11-02 18:24     ` Matthieu Moy
  0 siblings, 1 reply; 7+ messages in thread
From: Junio C Hamano @ 2015-11-02 18:05 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Harry Jeffery, git

Andreas Schwab <schwab@linux-m68k.org> writes:

> Harry Jeffery <harry@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...

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

* Re: git log --author=me
  2015-11-02 18:05   ` Junio C Hamano
@ 2015-11-02 18:24     ` Matthieu Moy
  0 siblings, 0 replies; 7+ messages in thread
From: Matthieu Moy @ 2015-11-02 18:24 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Andreas Schwab, Harry Jeffery, git

Junio C Hamano <gitster@pobox.com> writes:

> Andreas Schwab <schwab@linux-m68k.org> writes:
>
>> Harry Jeffery <harry@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.Moy@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 [<options>] [<revision-range>] [[--] <path>...]
       or: git show [<options>] <object>...
    
        -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/

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

* Re: git log --author=me
  2015-11-02 13:27 git log --author=me Harry Jeffery
  2015-11-02 17:50 ` Andreas Schwab
@ 2015-11-02 18:37 ` Duy Nguyen
  2015-11-03 10:26   ` Michael J Gruber
  1 sibling, 1 reply; 7+ messages in thread
From: Duy Nguyen @ 2015-11-02 18:37 UTC (permalink / raw)
  To: Harry Jeffery; +Cc: Git Mailing List

On Mon, Nov 2, 2015 at 2:27 PM, Harry Jeffery <harry@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

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

* Re: git log --author=me
  2015-11-02 18:37 ` Duy Nguyen
@ 2015-11-03 10:26   ` Michael J Gruber
  2015-11-03 21:30     ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Michael J Gruber @ 2015-11-03 10:26 UTC (permalink / raw)
  To: Duy Nguyen, Harry Jeffery; +Cc: Git Mailing List

Duy Nguyen venit, vidit, dixit 02.11.2015 19:37:
> On Mon, Nov 2, 2015 at 2:27 PM, Harry Jeffery <harry@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

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

* Re: git log --author=me
  2015-11-03 10:26   ` Michael J Gruber
@ 2015-11-03 21:30     ` Junio C Hamano
  0 siblings, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2015-11-03 21:30 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: Duy Nguyen, Harry Jeffery, Git Mailing List

Michael J Gruber <git@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 <git@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.

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

end of thread, other threads:[~2015-11-03 21:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-02 13:27 git log --author=me Harry Jeffery
2015-11-02 17:50 ` Andreas Schwab
2015-11-02 18:05   ` Junio C Hamano
2015-11-02 18:24     ` Matthieu Moy
2015-11-02 18:37 ` Duy Nguyen
2015-11-03 10:26   ` Michael J Gruber
2015-11-03 21:30     ` Junio C Hamano

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.