git-smartlist 1.0 released

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

For a while I've been using some shortcuts to visualize my specific
changes in comparison to some upstream/official/master changes.

For example, if I just do "gitk @" it takes a while to load the 61K
commits that are part of the "current branch", when in fact I'm
interested in only 10 or so.

I can simply do "gitk master..@", and that does the trick, but it gets
to be a bit tedious to type that every single time.

Moreover, maybe I'm interested in two branches: "fc/feature-a", and
"fc/feature-b". I can find the specific commits with "fc/feature-a
fc/feature-b ^master".

But what if they are not based on "master", but "next". Or worse; what
if one is based on "next", and the other on "stable"?

Easy, you just do "fc/feature-a fc/feature-b --not $(git merge-base
fc/feature-a fc/feature-b)".

At this point it should be clear that perhaps a helper would help.

This is the primary problem git-smartlist is trying to solve.

In its essence git-smartlist tries to generate the revision list you
most likely want.

The whole point is to avoid typing as much as possible, and generate
minimal, yet useful, revlist.

In its main mode without any arguments git-smartlist simply generates
"@{upstream}..@". If you specify a branch, it will generate
"branch@{upstream}..branch". In both cases if no upstream branch is
configured, "master" will be used.

Then, if more than two branches are specified (e.g. fc/feature-a,
fc/feature-b), git-smartlist will find the merge base of both and do
"fc/feature-a fc/feature-b --not $merge_base".

To configure an alias for this mode:

  ls = smartlist log specific

Then, typing "git ls" will trigger this mode, and you can do "git ls",
"git ls fc/feature-a", or "git ls fc/feature-a fc/feature-b".

You can replace "log" with your favorite command. In my case it's `lg`
(log --oneline --decorate --boundary --graph).

A second very useful mode is "branches". If you specify more than one
branch it's the same as the "specific" mode, however, if you don't
specify any argument it will be the same as "--branches --not
$merge_base", and if you specify a namespace like "fc/" it will be
"--branches=fc/ --not $merge_base", or you can specify a prefix as
well "fc-*" -> "--branches=fc-* --not $merge_base".

I use this a lot when I want to see a bunch of branches with a certain
prefix, for example: "git lb fc/completion/".

If on the other hand you use gitk a lot--like me--you might want to
consider this alias:

  v = "!f() { gitk \"$@\" & }; f

Then you can have shortcuts for both text (lg) and visual (gitk)
exploration of the commits.

  ls = smartlist lg specific
  lb = smartlist lg branches
  vs = smartlist v specific
  vb = smartlist v branches

For more information check the repository in GitHub.

https://github.com/felipec/git-smartlist

Cheers.

--
Felipe Contreras



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux