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

Re: [PATCH 0/3] Support config-based names

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jun 12, 2007, 03:31 UTC
Message-ID
<20070612033134.GS6073@spearce.org>
In-Reply-To
<Pine.LNX.4.64.0706112244210.5848@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> wrote:
> It can be useful to refer to commits in remotes based on their configured 
> relationship to local branches. For example, "git log HEAD^[push]..HEAD" 
> would, when pushing is set up, show what hasn't been pushed yet.
Interesting.
What about `git diff master^[push]@{3.days.ago}^{tree} master` ?

Can anyone even understand that? Can Git even understand it? As I follow your code I don't think it would, as the ^[push] operator seems like it needs to be on the very end of the string, and it assumes everything to the left of the ^[ is the branch name. So I also couldn't phrase that as:

  git diff master@{3.days.ago}^[push]^{tree} master

More interesting is just what do you want going on here with the reflog query and the ^[push] query. Should the reflog operator apply before the ^[push] translation, or after? Or should it depend on the order of them in the statement? I can see where you would want to look at your local tracking branch for the current branch 3 days ago, which might be "HEAD^[push]@{3.days.ago}". But I'm not really sure what the meaning of "HEAD@{3.days.ago}^[push]" is. Is that the branch that HEAD was on 3 days ago's push branch? Huh? ;-)

Food for thought.

In general it seems our "operators" are ^{foo} or @{foo}, so I wonder why not ^{push}. push is not a valid object type, and probably never will be, so peeling the onion back to get to what ^{push} means (even though its not an object type) is probably OK.

-- 
Shawn.
Previous: Daniel BarkalowNext: Daniel Barkalow
Message 2 of 6 in “Support config-based names”
  1. 0/3 Support config-based namesDaniel Barkalow, Jun 12, 2007
  2. Shawn O. PearceJun 12, 2007
  3. Daniel BarkalowJun 12, 2007
  4. Junio C HamanoJun 12, 2007
  5. Daniel BarkalowJun 12, 2007
  6. Junio C HamanoJun 12, 2007

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.