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

[PATCH 0/3] Support config-based names

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Jun 12, 2007, 03:10 UTC
Message-ID
<Pine.LNX.4.64.0706112244210.5848@iabervon.org>

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.

I picked base^[word] as the format for sha1 names which are some arbitrary function of base. I think this format isn't used for anything yet, isn't valid as ref names, and is structureally suitable for having a variety of extensions. I added {branch}^[merge] for the default head to merge into {branch} and {branch}^[push] for the tracking ref for the remote branch to push {branch} to. The push one could be extended to include the branch to push to by default at other remotes as {branch}^[push:{remote}]. I'm not too picky about the format for this, if there's something better for the space of sha1 names that don't have to be super compact and may have lots of options.

(In order to prepare this email, I set up a push default of my branch to next, and did: "git log --reverse HEAD^[push]..HEAD" and "git diff --stat HEAD^[push]...HEAD")

Patch 1 is likely to be independantly useful for things like a builtin-fetch, which needs to get configuration for branches along with remotes.

 Patch 1: Parse and report branch config
 Patch 2: Search for matching push refspec in configuration
 Patch 3: Add sha1 names using the preceding functions
 remote.c    |  109 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
 remote.h    |   22 +++++++++++-
 sha1_name.c |   50 +++++++++++++++++++++++++++
 3 files changed, 166 insertions(+), 15 deletions(-)
	-Daniel
*This .sig left intentionally blank*
Next: Shawn O. Pearce
Message 1 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.