home | list info | list archive | date index | thread index

Re: [SIGS-L3GO] Some git stuff

Don't comment on this list very often, but you could always just use a git
alias to save the majority of the command, which helps if you're like me
and use too many tools to remember the options to all of them:
https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases

My fav aliases:

[alias]
    lg1 = log --graph --abbrev-commit --decorate --date=relative
--format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset)
%C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'
--all
    lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold
blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold
green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n''
%C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
    lg = !"git lg1"
    ignore=!([ ! -e .gitignore ] && touch .gitignore) | echo $1 >>.gitignore
    sn = show --name-status

The lg1 and lg2 are great for visualizing branches.

-Devin


On Sun, May 15, 2016 at 11:42 AM, Richard Guy Briggs <rgb [ at ] tricolour [ dot ] ca>
wrote:

> On 16/05/10, Alex Pilon wrote:
> > Note that for the last three, you can also do stuff like this:
> >
> >     git graph -SWiFi --author Alex Pilon --word-diff
> --word-diff-regex='\S' -w -- .profile.d
>
> Ok, so I just tried looking for all patches that affected a particular
> function, and came up with no suitable search method.  The -S option only
> searches for patches that add or remove that symbol.  The --all-match
> option
> only searches for patches that mention that pattern in the --author,
> --commiter or
> --grep for the log message.  I'm left with limiting to a path and then
> grepping
> the output for that function name and manually sorting through the
> output.  git
> blame can be more effective here, but again, need to manually sort through
> the
> output and iteratively git blame through commits mentioned in a function
> and
> that is limited by missing commits that remove lines.  Are you familiar
> with
> any search options that let me set a search pattern for any match in the
> commit
> patch rather than just symbol addition or removal?
>
> > Yeah, that's a mouthful. Use a shell with decent auto-completion, and
> > have coworkers constantly throwing code your way that *warrants* this.
> > It only takes <2 seconds to type anyway, which is far less than it would
> > take for you to do in a GUI.
>
> Less than 2 seconds to type if you type at 420 words per minute and you
> actually use those options often enough that you know what they do and how
> they
> are spelled.
>
> I think we all agreed at the table that if you use something often enough,
> it
> can be far more efficient to use a text-based tool, but for something that
> is
> used infrequently, it is more efficient to use the gui simply due to the
> overhead of reading and understanding the manpage.
>
> > Alex Pilon
>
>         slainte mhath, RGB
>
> --
> Richard Guy Briggs               --  ~\    -- ~\             <
> hpv.tricolour.ca>
> <www.TriColour.ca>                 --  \___   o \@      @        Ride yer
> bike!
> Ottawa, ON, CANADA                  --  Lo_>__M__\\/\%__\\/\%
> Vote! -- <greenparty.ca
> >_____GTVS6#790__(*)__(*)________(*)(*)_________________
> _______________________________________________
> SIGS-L3GO mailing list
> SIGS-L3GO [ at ] lists [ dot ] oclug [ dot ] on [ dot ] ca
> http://oclug.on.ca/mailman/listinfo/sigs-l3go
>

references

message navigation