From: Paul Gardiner <osronline@glidos•net>
To: git@vger•kernel.org
Subject: Re: Best way to specify all local branches and all remote branches.
Date: Mon, 11 Feb 2008 19:40:38 +0000 [thread overview]
Message-ID: <47B0A4B6.2090408@glidos.net> (raw)
In-Reply-To: <m3ir0ve2c1.fsf@localhost.localdomain>
Jakub Narebski wrote:
> Paul Gardiner <osronline@glidos•net> writes:
>
>> New to git, and often finding it hard to specify the correct
>> refs for a command. Here's an example where I was converting
>> all the files in all the commits from unix line endings to
>> DOS line endings. You can see I've ended up using cd and ls.
>> I'm sure there must be a better way.
>
> git-for-each-ref, git-show-ref, git-ls-remote / git-peek-remote.
Ah right, those look hellishly useful, thanks.
>> $ cd /home/public/tmp/git/
>> $ yes |rm -r vdos32
>> $ git clone /export/git/vdos32.git vdos32
>> $ cd vdos32/
>> $ for f in `(cd /export/git/vdos32.git/refs/heads; ls)|sed -e
>> '/master/d' -e '/origin/d'`; do git fetch origin $f:$f; done
>> $ git-filter-branch --tag-name-filter cat --tree-filter 'find . -type f
>> ! -name \*.gif ! -name \*.ico|xargs unix2dos -q' `(cd
>> .git/refs/heads;ls)`
>
> If you want to fetch all branches, you can specify globbing refspec;
> of course if you use separate remotes layout, or mirror layout.
I think I tried that with my line 5 above. I tried
refs/heads/*:refs/heads/* as the ref spec. Should something like that
work?
> If you want to pass all branches to git command, usually --all would
> be enough (sometimes --heads).
>
>> With git-filter-branch, I'm surprised I can't use --all.
>
> git-filter-branch is about single branch; I'm not sure if it should
> support --all.
It seems to work with multiple branches, and I think it's important
that it does, because as far as I can tell, that's the only way
to filter a whole repository without visiting some commits more
than once. Certainly my command, using cd/ls, worked and visited
each commit exactly once.
Cheers,
Paul.
next prev parent reply other threads:[~2008-02-11 19:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-11 18:51 Best way to specify all local branches and all remote branches Paul Gardiner
2008-02-11 19:10 ` Jakub Narebski
2008-02-11 19:40 ` Paul Gardiner [this message]
2008-02-11 20:23 ` Johannes Schindelin
2008-02-11 21:00 ` Paul Gardiner
2008-02-11 21:34 ` Jakub Narebski
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=47B0A4B6.2090408@glidos.net \
--to=osronline@glidos$(echo .)net \
--cc=git@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox