[PATCH 0/3] Support config-based names
From: Daniel Barkalow <hidden>
Date: 2016-06-15 22:43:15
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*