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 18, 2011, 14:52 UTC
Message-ID
<CAH3AnrpahkHtnu5QTRns-vVcCoj3Q8JM-mzytYF2ZC_EXjU7Xw@mail.gmail.com>
In-Reply-To
<4E4A76E7.2090100@drmicha.warpmail.net>

On Tue, Aug 16, 2011 at 11:55 PM, Michael J Gruber <git@drmicha.warpmail.net> wrote:

Show 18 quoted lines
> Jon Seymour venit, vidit, dixit 08.08.2011 12:43:
>> On Mon, Aug 8, 2011 at 8:22 PM, Jon Seymour <jon.seymour@gmail.com> wrote:
>>> On Mon, Aug 8, 2011 at 7:45 PM, Jakub Narębski <jnareb@gmail.com> wrote:
>>>> On 8/8/11, Jon Seymour <jon.seymour@gmail.com> wrote:
>>
>> I've also added this...
>>
>> Listing the tips of branches in pu that are not in master
>> ===========================================
>>
>> Suppose you have two aliases defined like so:
>>
>> [alias]
>>         oneline = !/usr/bin/xargs -L1 git log --decorate --max-count=1 --oneline
>
> How about
>
> oneline = git log --no-walk --decorate --oneline

I still need to !/usr/bin/xargs -L1m, don't I? The point is to transform a list of SHA1s into a decorated list. But point taken about --no-walk being an alternative to --max-count=1.

> git branch --merged origin/pu --contains origin/next
>
> (or with --no-merged, but put it first.)
>

So, the idea with tips is that it will show you the tips of independent lines of development that have diverged from origin/next (or before) that have been merged back into origin/pu. This works, even if you don't have branches assigned to these tips.

In this example:
A-----B---E---F---G---H
\-----C--/   /
 \ ----D----/

git tips F will show B, C, D as the tips of branches that have diverged from the mainline but have merged back in.

If I want to rebuild F' which does not include C, then git tips F tells me that I have to merge B and D.

The git tips alias abstracts the function of 'git work list dependency' which is a function of git extension (git work) that I have been playing around with for a while.

I use git work to manage a private integration branch which includes all my current published but unintegrated-upstream topics. If I decide I want to unmerge one of these topics from my integration branch, I'd do something like:

     git work unmerge C
Which does the equivalent of:
   git checkout B
   git merge D
   git rebase --onto HEAD F H
Show 5 quoted lines
>>
>> which is a list of the tips of branches that are in pu, but not in next.
>
> That's not quite the standard --decorate, is it? ;)
>

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.

jon.
Previous: Michael J GruberNext: Michael J Gruber
Message 7 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.