git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: RFC: repository of handy git aliases?

From
Jon Seymour <jon.seymour@gmail.com>
Date
Aug 19, 2011, 06:15 UTC
Message-ID
<CAH3AnrpBE+xDfQ=mPDcFRx+C+b9SHS7T9njA8A6Xu4m82vu1Xw@mail.gmail.com>
In-Reply-To
<4E4D3281.2050600@drmicha.warpmail.net>

On Fri, Aug 19, 2011 at 1:40 AM, Michael J Gruber <git@drmicha.warpmail.net> wrote:

> Is this a typo or do you have an xargs which understands "1m"? My point
> was that you can feed all tips to "log" at once, as long as you don't
> exceed the argument list limits, of course.
Yeah, meant -L1, not -L1m.

Ok, so you are suggesting something like: git oneline $(git tips origin/pu ^ origin/next) instead of

    git tips origin/pu ^origin/next | git oneline

I guess it comes down to a preference thing, but it is good to know that with --no-walk I can do it either way, so thanks!

Here's a alias definition for oneline that does it both ways, depending on preference...

[alias]
        oneline ="!_() { if test $# -eq 0; then xargs -L1 git log
--no-walk --decorate --oneline; else git log --no-walk --decorate
--oneline \"$@\"; fi; }; _"
Show 19 quoted lines
>>
>> Not sure what you mean by not being standard? The main idea about
>> using --decorate here is to get a dump of any refs that might describe
>> the identified tips.
>
> Just compare your output with this:
>
> git log --decorate --no-walk --oneline origin/{master,next,pu}
> a46e511 (origin/pu) Merge branch 'fg/submodule-git-file-git-dir' into pu
>
> 0e3f8f0 (origin/next) Merge branch 'master' into next
>
> 4bfe7cb (origin/master, origin/HEAD) Sync with "maint"
>
> That is, I get the branch decorations there; you use the same format but
> don't get any. But I may be misunderstanding completely what you are
> trying to achieve. I guess I have to reread your extended use case
> description...
>

Ok, so the only reason my output didn't show any tags is that there didn't happen to be any.

With a local integration branch, there usually will be local references that explain each tip. So, for example, git tips master for me currently shows:

git tips master | git oneline  shows:

f85a051 (kernel/master) Update draft release notes to 1.7.7 9e90d12 (refactor) rename auto-edit -> refactor. e586f2e (gitwork-dist) Regenerate git-work.zip dbb64d9 (tag: gitwork-v0.0.11, public/gitwork, gitwork) git-work: update documentation. 272277f (bisect-gettextln) bisect: take advantage of gettextln, eval_gettextln.

So this does show helpful decorations. The reason git tips origin/pu ^origin/next | git oneline doesn't show any decorations is simply because I don't have any tags or branches that represent those tips - Junio presumably does, for example.

Note also that git tips doesn't show merge commits.
The best way to understand what git tips does is to do this:
     gitk origin/pu ^origin/next --no-merges

The commits reported by git tips are the tips of each linear stream of development you see in gitk.

jon.
Previous: Michael J Gruber
Message 9 of 9 in “RFC: repository of handy git aliases?”
  1. Jon SeymourAug 8, 2011
  2. Jakub NarębskiAug 8, 2011
  3. Jon SeymourAug 8, 2011
  4. Jon SeymourAug 8, 2011
  5. Jon SeymourAug 8, 2011
  6. Michael J GruberAug 16, 2011
  7. Jon SeymourAug 18, 2011
  8. Michael J GruberAug 18, 2011
  9. Jon SeymourAug 19, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.