1610.2.1
by James Blackwell
Copied in docs for wiki & First round cleanup |
1 |
Command aliases are an eay way to customize the behaviour of Bazaar-NG. Aliases |
2 |
are an easy way to create shortcuts for commonly-typed commands, or to set |
|
3 |
defaults for commands. |
|
4 |
||
1610.2.2
by James Blackwell
Now they look good in rst2html |
5 |
Command aliases can be defined in the **[ALIASES]** section of your |
1610.2.1
by James Blackwell
Copied in docs for wiki & First round cleanup |
6 |
**.bazaar/bazaar.conf** file. Aliases start with the alias name, then an |
7 |
equal sign, then a command fragment. Here's an example ALIASES section: |
|
8 |
||
9 |
Examples |
|
10 |
======== |
|
1610.2.2
by James Blackwell
Now they look good in rst2html |
11 |
A typical example:: |
12 |
||
1610.2.1
by James Blackwell
Copied in docs for wiki & First round cleanup |
13 |
[ALIASES] |
14 |
recentlog=log -r-3..-1 |
|
15 |
ll=log --line -r-10..-1 |
|
16 |
commit=commit --strict |
|
17 |
diff=diff --diff-options -p |
|
18 |
||
19 |
Explanation of examples |
|
20 |
======================= |
|
21 |
||
22 |
* The first alias makes a new 'recentlog' command that shows the logs for the |
|
1610.2.2
by James Blackwell
Now they look good in rst2html |
23 |
last three revisions |
24 |
* The **ll** alias shows the last 10 log entries in line format. |
|
25 |
* the **commit** alias sets the default for commit to refuse to commit if new |
|
26 |
files in the tree are not recognized. |
|
27 |
* the **diff** alias adds the coveted -p option to diff |
|
1610.2.1
by James Blackwell
Copied in docs for wiki & First round cleanup |
28 |
|
29 |
||
30 |
Rules for Aliases |
|
31 |
================= |
|
32 |
||
33 |
* You can override parts of the options given in an alias by overriding it. |
|
1610.2.2
by James Blackwell
Now they look good in rst2html |
34 |
For example, if you run **lastlog -r-5..**, you will only get five |
1610.2.1
by James Blackwell
Copied in docs for wiki & First round cleanup |
35 |
line-based log entries instead of 10. |
36 |
* Aliases can override the standard behaviour of existing commands by giving |
|
37 |
an alias name that is thesame as the orignal command. For example, default |
|
1610.2.2
by James Blackwell
Now they look good in rst2html |
38 |
commit is changed with **commit=commit --strict**. |
1610.2.1
by James Blackwell
Copied in docs for wiki & First round cleanup |
39 |
* Aliases can not refer to other aliases. In other words making a |
1610.2.2
by James Blackwell
Now they look good in rst2html |
40 |
**lastlog** alias and referring to it with a **ll** alias will not work. |
1610.2.1
by James Blackwell
Copied in docs for wiki & First round cleanup |
41 |
|
42 |
This includes aliases that override standard commands |
|
43 |
||
1610.2.2
by James Blackwell
Now they look good in rst2html |
44 |
* Giving the **--no-aliases** to the bzr command will tell it to ignore aliases |
45 |
for that run. For example, running **bzr --no-aliases commit** will perform a |
|
46 |
standard commit instead not do a **commit --strict**. |
|
47 |