Re: [PATCH 0/3] subtree: add 'git-subtree-repo' and list command

2016-05-21 Thread David A. Greene
Nicola Paolucci  writes:

> 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.

Thanks for working on this.  I just sent a reply to your earlier
iteration.

What is the intent for use of this?  Is it simply to record from where
commits were pulled or do you intend to use this information later on to
have git-subtree guess from where to fetch future commits?

I would be opposed to the latter because I think it potentially limits
the utility of git-subtree and may be misleading.  I frequently pull
commits for a subtree from several different clones of the same
reposiory.  How does git-subtree list handle that situation?

Does git-subtree list really print out repository information for every
commit added by git-subtree?  That's potentially a lot of commits.  It
might be more useful to aggregate repository information and only dump
out unique URLs.  In any case, processing all commits seems like a ton
of work for such a simple operation.  Maybe this information should be
cached in .gitconfig.

I'm actually in the middle of cleaing up metadata but I'm not going to
block these commits due to that.  Just be aware that it may change a
bit.

  -David
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/3] subtree: add 'git-subtree-repo' and list command

2016-03-10 Thread Nicola Paolucci
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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html