want to specify a file pattern for 'bzr add'

Bug #490187 reported by Martin Pool
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Wishlist
Unassigned

Bug Description

Hi!

It is possible to use (or to add as an option) "bzr add" with a include pattern, so that only files matching a certain pattern will be added? This is a quite helpful option in hg add, and helped to only add for instance *.cpp *.h and to not accidentally add compiled or whatever files to the rep.

Greetings,
Andre

Revision history for this message
Martin Pool (mbp) wrote :

There are two possible workarounds:

1- Add ignore patterns for things you don't want to add, then do 'bzr add' on a directory or on the whole tree.

2- Let your shell do the pattern expansion, eg 'bzr add **/*.cpp'

Changed in bzr:
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
Andre Massing (massing) wrote : Re: [Bug 490187] Re: want to specify a file pattern for 'bzr add'

Thanks for the pointer, learned a bit about my shell and activating the
globstar pattern ("shopt -s globstar" for bash). That is a good
workaround, but nice, that you added an item to the wishlist, since an
option would make it platform- and shell-independent from a user's point
of view.

Martin Pool wrote:
> There are two possible workarounds:
>
> 1- Add ignore patterns for things you don't want to add, then do 'bzr
> add' on a directory or on the whole tree.
>
> 2- Let your shell do the pattern expansion, eg 'bzr add **/*.cpp'
>
> ** Changed in: bzr
> Status: New => Confirmed
>
> ** Changed in: bzr
> Importance: Undecided => Wishlist
>

Revision history for this message
grigsoft (grigsoft) wrote :

I think this can be extended to optional usage of "include" logic, instead of "ignore". This can be done either by supporting negative rules in .ignore, like:
*
!*.cpp
!*.h
to include just these files, or, even better, create .include file to list interested files.

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.