git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Support config-based names
@ 2007-06-12  3:10 Daniel Barkalow
  2007-06-12  3:31 ` Shawn O. Pearce
  2007-06-12  5:28 ` Junio C Hamano
  0 siblings, 2 replies; 6+ messages in thread
From: Daniel Barkalow @ 2007-06-12  3:10 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

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*

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-06-12  6:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-12  3:10 [PATCH 0/3] Support config-based names Daniel Barkalow
2007-06-12  3:31 ` Shawn O. Pearce
2007-06-12  4:13   ` Daniel Barkalow
2007-06-12  5:28 ` Junio C Hamano
2007-06-12  5:56   ` Daniel Barkalow
2007-06-12  6:44     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).