Re: [git-users] extracting subdirectory from git repo

2013-09-18 Thread Gabriel Marchesan Almeida
That's great, thanks a lot Konstantin!

On Tuesday, September 17, 2013 3:47:27 PM UTC+2, Konstantin Khomoutov wrote:

 On Tue, 17 Sep 2013 05:21:08 -0700 (PDT) 
 Gabriel Marchesan Almeida gabrielm...@gmail.com javascript: wrote: 

  I am trying to extract subdirectories from a git repo and I have done 
  so far these steps.. 
 ---Filter
  

  subdirectory 
  
  git filter-branch --tag-name-filter cat --prune-empty 
  --subdirectory-filter ./Subfolder HEAD 
  
   Delete history 
  
  git reset --hard 
  git for-each-ref --format=%(refname) refs/original/ | xargs -n 1 
  git update-ref -d git reflog expire --expire=now --all 
  git gc --aggressive --prune=now 
  
  
 ---
  

  
  The problem is that it extracts all the tags and not the only ones 
  from this repo. 

 What do you mean by from this repo?  There's no such thing as tags 
 from this repo and tags not from this repo. 

 Or do you mean the resulting repository contains tags pointing to 
 commits which do not belong to the new set of commits `git 
 filter-branch` created when it was synthesizing the new history? 

 Then I'd say the way to go would be along the lines of: 

 $ (git rev-list --branches 
   | while read c; do git tag --contains $c; done) | 
   sort -u /tmp/valid 
 $ git tag --list | grep -v -F -f /tmp/valid | 
   while read t; do git tag -d $t; done 

 That is, on the first step create a list of all tags pointing to 
 commits reachable from your branches then on the second step obtain the 
 list of tags which are not in the set generated on the previous step, 
 and delete them.  I have not tested this solution -- it's just an idea. 


-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[git-users] repo tool from google (android development)

2013-09-19 Thread Gabriel Marchesan Almeida
Hi colleagues,

Considering I have multiple repositories in my manifest file.

Do you know any way I could refer to different commit hashs on each one of 
the repositories ?

i.e

repo1 hash #eee33343443
repo2 hash #3f3f3f323f

repoN hash #hjashdjhjh

or if I could even use TAGS for that?

Thanks  regards
Gabriel


-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[git-users] Re: repo tool from google (android development)

2013-09-19 Thread Gabriel Marchesan Almeida
Thanks for your answer Thomas,

However this is not what I am looking for.

git-submodules  is nice when you have stable components or third party 
libraries where you can easily choose the version you want to update for 
different components. However, IFIK, it does not allow you to do changes in 
these repositories (commits, etc.), repotool from google allow you to do 
that, it basically clones different repo for you based on a so-called 
manifest file (xml file with repos information, url, etc.).

However I am wondering if it is possible to point to a given TAG or commit 
on the configuration parameters of repo tool.

If anyone knows, a small example will be very helpful. 

Thanks

On Thursday, September 19, 2013 2:26:01 PM UTC+2, Thomas Ferris Nicolaisen 
wrote:


 On Thursday, September 19, 2013 1:40:33 PM UTC+2, Gabriel Marchesan 
 Almeida wrote:

 Hi colleagues,

 Considering I have multiple repositories in my manifest file.

 Do you know any way I could refer to different commit hashs on each one 
 of the repositories ?

 i.e

 repo1 hash #eee33343443
 repo2 hash #3f3f3f323f

 repoN hash #hjashdjhjh

 or if I could even use TAGS for that?


 Sounds like a typical case for git submodules: 
 https://www.kernel.org/pub/software/scm/git/docs/git-submodule.html 


-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[git-users] Re: repo tool from google (android development)

2013-09-19 Thread Gabriel Marchesan Almeida
I just found this very interesting..

I think revision would do the trick:

http://stackoverflow.com/questions/10818758/repo-init-a-particular-commit

Hope it helps!

On Thursday, September 19, 2013 2:39:52 PM UTC+2, Gabriel Marchesan Almeida 
wrote:

 Thanks for your answer Thomas,

 However this is not what I am looking for.

 git-submodules  is nice when you have stable components or third party 
 libraries where you can easily choose the version you want to update for 
 different components. However, IFIK, it does not allow you to do changes in 
 these repositories (commits, etc.), repotool from google allow you to do 
 that, it basically clones different repo for you based on a so-called 
 manifest file (xml file with repos information, url, etc.).

 However I am wondering if it is possible to point to a given TAG or commit 
 on the configuration parameters of repo tool.

 If anyone knows, a small example will be very helpful. 

 Thanks

 On Thursday, September 19, 2013 2:26:01 PM UTC+2, Thomas Ferris Nicolaisen 
 wrote:


 On Thursday, September 19, 2013 1:40:33 PM UTC+2, Gabriel Marchesan 
 Almeida wrote:

 Hi colleagues,

 Considering I have multiple repositories in my manifest file.

 Do you know any way I could refer to different commit hashs on each one 
 of the repositories ?

 i.e

 repo1 hash #eee33343443
 repo2 hash #3f3f3f323f

 repoN hash #hjashdjhjh

 or if I could even use TAGS for that?


 Sounds like a typical case for git submodules: 
 https://www.kernel.org/pub/software/scm/git/docs/git-submodule.html 



-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [git-users] extracting subdirectory from git repo

2013-09-20 Thread Gabriel Marchesan Almeida
Konstantin, me again.

I have realized that when running your commands directly on prompt command, 
they work pretty fine and I have an output on /tmp/valid, which is exactly 
the TAG i want to keep.

However when putting the command in a bash script, I have always empty 
/tmp/valid.

I am having problems to figure out where the problem is coming from.

Small area of my script.

http://screenpresso.com/=zAske

Thanks in advance for your help!

On Tuesday, September 17, 2013 3:47:27 PM UTC+2, Konstantin Khomoutov wrote:

 On Tue, 17 Sep 2013 05:21:08 -0700 (PDT) 
 Gabriel Marchesan Almeida gabrielm...@gmail.com javascript: wrote: 

  I am trying to extract subdirectories from a git repo and I have done 
  so far these steps.. 
 ---Filter
  

  subdirectory 
  
  git filter-branch --tag-name-filter cat --prune-empty 
  --subdirectory-filter ./Subfolder HEAD 
  
   Delete history 
  
  git reset --hard 
  git for-each-ref --format=%(refname) refs/original/ | xargs -n 1 
  git update-ref -d git reflog expire --expire=now --all 
  git gc --aggressive --prune=now 
  
  
 ---
  

  
  The problem is that it extracts all the tags and not the only ones 
  from this repo. 

 What do you mean by from this repo?  There's no such thing as tags 
 from this repo and tags not from this repo. 

 Or do you mean the resulting repository contains tags pointing to 
 commits which do not belong to the new set of commits `git 
 filter-branch` created when it was synthesizing the new history? 

 Then I'd say the way to go would be along the lines of: 

 $ (git rev-list --branches 
   | while read c; do git tag --contains $c; done) | 
   sort -u /tmp/valid 
 $ git tag --list | grep -v -F -f /tmp/valid | 
   while read t; do git tag -d $t; done 

 That is, on the first step create a list of all tags pointing to 
 commits reachable from your branches then on the second step obtain the 
 list of tags which are not in the set generated on the previous step, 
 and delete them.  I have not tested this solution -- it's just an idea. 


-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[git-users] Re: extracting subdirectory from git repo

2013-10-01 Thread Gabriel Marchesan Almeida
Hi Konstantin,

Sorry for my late reply, I was in a trip and could not check it.

Please have a look at:

http://pastebin.com/VzfwVin2

If I run all steps directly on prompt, it works (you can observe that after 
filtering I have to create a branch so I can trigger this command: 

(git rev-list --branches | while read c; do git tag --contains $c; done) | 
sort -u /tmp/valid

However, when running the bash it does not work (in the end I have 
/tmp/valid empty when running the script).

http://pastebin.com/KTuHkAA7

On Tuesday, September 17, 2013 2:21:08 PM UTC+2, Gabriel Marchesan Almeida 
wrote:

 Dear colleagues,

 I am trying to extract subdirectories from a git repo and I have done so 
 far these steps..


 ---Filter
  
 subdirectory 

 git filter-branch --tag-name-filter cat --prune-empty --subdirectory-filter 
 ./Subfolder HEAD

  Delete history 

 git reset --hard
 git for-each-ref --format=%(refname) refs/original/ | xargs -n 1 git 
 update-ref -d
 git reflog expire --expire=now --all
 git gc --aggressive --prune=now 


 ---

 The problem is that it extracts all the tags and not the only ones from 
 this repo. 

 Would you have any idea how could I do it?

 Thanks  regards


-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.