All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicola Paolucci <npaolucci@atlassian.com>
To: git@vger.kernel.org
Cc: Dave <davidw@realtimegenomics.com>,
	"David A . Greene" <greened@obbligato.org>,
	Mathias Nyman <mathias.nyman@iki.fi>,
	Nicola Paolucci <npaolucci@atlassian.com>
Subject: [PATCH 0/3] subtree: add 'git-subtree-repo' and list command
Date: Thu, 10 Mar 2016 10:44:09 +0100	[thread overview]
Message-ID: <1457603052-53963-1-git-send-email-npaolucci@atlassian.com> (raw)

To my knowledge 'git subtree' currently lacks a way to
track where injected repositories come from originally.
Adding this information allows for useful extensions to 
the command and makes it easier to use subtrees to track
external dependencies.

In this patch series I propose to add a 'git-subtree-repo'
line to the meta-data stored when injecting a tree
in a repository with 'git subtree add'. The result looks 
like this:

    git-subtree-dir: .vim/bundle/fireplace
    git-subtree-split: b999b09cd9d69f359fa5668e81b09dcfde455cca
    git-subtree-repo: https://repo/user/vim-fireplace.git

Thanks a lot to Mathias Nyman who has cleaned up my idea to
add 'git-subtree-repo' and already submitted it for review.
I added a test and a tiny fix to his patch and I resend it 
here (hence the v3 in the first patch).

Using this extra value a simple 'git subtree list' command can 
be implemented which scans the checked out branch for subtrees
injected:

    $ git subtree list
    .vim/bundle/fireplace https://github.com/tpope/vim-fireplace.git b999b0

I also added an optional '--resolve' flag to retrieve symbolic
remote refs associated with the commit ids of the remote repository:

    $ git-subtree.sh list --resolve
    
    vim-airline  https://repo/bling/vim-airline.git 4fa37e5e[...]
    vim-airline  https://repo/bling/vim-airline.git HEAD
    vim-airline  https://repo/bling/vim-airline.git refs/heads/master


Nicola Paolucci (3):
  contrib/subtree: 'add' stores 'git-subtree-repo'
  contrib/subtree: new list command to list subtrees
  contrib/subtree: list --resolve gets symbolic refs

 contrib/subtree/git-subtree.sh     | 140 +++++++++++++++++++++++++++++--------
 contrib/subtree/git-subtree.txt    |  31 ++++++++
 contrib/subtree/t/t7900-subtree.sh |  63 +++++++++++++++++
 3 files changed, 205 insertions(+), 29 deletions(-)

-- 
2.7.1

             reply	other threads:[~2016-03-10  9:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-10  9:44 Nicola Paolucci [this message]
2016-03-10  9:44 ` [PATCH v3 1/3] contrib/subtree: 'add' stores 'git-subtree-repo' Nicola Paolucci
2016-03-10  9:44 ` [PATCH 2/3] contrib/subtree: new list command to list subtrees Nicola Paolucci
2016-03-10  9:44 ` [PATCH 3/3] contrib/subtree: list --resolve gets symbolic refs Nicola Paolucci
2016-05-21 22:59 ` [PATCH 0/3] subtree: add 'git-subtree-repo' and list command David A. Greene

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1457603052-53963-1-git-send-email-npaolucci@atlassian.com \
    --to=npaolucci@atlassian.com \
    --cc=davidw@realtimegenomics.com \
    --cc=git@vger.kernel.org \
    --cc=greened@obbligato.org \
    --cc=mathias.nyman@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.