~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/using_aliases.txt

  • Committer: Robert Collins
  • Date: 2007-07-04 08:08:13 UTC
  • mfrom: (2572 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2587.
  • Revision ID: robertc@robertcollins.net-20070704080813-wzebx0r88fvwj5rq
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
are an easy way to create shortcuts for commonly-typed commands, or to set
7
7
defaults for commands.
8
8
 
9
 
Command aliases can be defined in the **[ALIASES]** section of your
10
 
**.bazaar/bazaar.conf** file. Aliases start with the alias name, then an
 
9
Command aliases can be defined in the ``[ALIASES]`` section of your
 
10
``.bazaar/bazaar.conf`` file. Aliases start with the alias name, then an
11
11
equal sign, then a command fragment.  Here's an example ALIASES section:
12
12
 
13
13
Examples
23
23
Explanation of examples
24
24
=======================
25
25
 
26
 
 * The first alias makes a new 'recentlog' command that shows the logs for the
 
26
 * The first alias makes a new ``recentlog`` command that shows the logs for the
27
27
   last three revisions
28
 
 * The **ll** alias shows the last 10 log entries in line format.
29
 
 * the **commit** alias sets the default for commit to refuse to commit if new
 
28
 * The ``ll`` alias shows the last 10 log entries in line format.
 
29
 * the ``commit`` alias sets the default for commit to refuse to commit if new
30
30
   files in the tree are not recognized.
31
 
 * the **diff** alias adds the coveted -p option to diff
32
 
 
 
31
 * the ``diff`` alias adds the coveted -p option to diff
 
32
 
 
33
Using the Aliases
 
34
=================
 
35
The aliases defined above would be used like so: ::
 
36
 
 
37
   % bzr recentlog
 
38
   % bzr ll
 
39
   % bzr commit
 
40
   % bzr diff
33
41
 
34
42
Rules for Aliases
35
43
=================
36
44
 
37
 
 * You can override parts of the options given in an alias by overriding it.
38
 
   For example, if you run **lastlog -r-5..**, you will only get five
39
 
   line-based log entries instead of 10.
 
45
 * You can override a portion of the options given in an alias by
 
46
   specifying the new part on the command-line.  For example, if
 
47
   you run ``lastlog -r-5..``, you will only get five line-based log
 
48
   entries instead of 10.  Note that all boolean options have an
 
49
   implicit inverse, so you can override the commit alias with
 
50
   ``commit --no-strict``.
 
51
 
40
52
 * Aliases can override the standard behaviour of existing commands by giving
41
 
   an alias name that is thesame as the orignal command. For example, default
42
 
   commit is changed with **commit=commit --strict**.
43
 
 * Aliases can not refer to other aliases. In other words making a
44
 
   **lastlog** alias and referring to it with a **ll** alias will not work.
45
 
 
46
 
This includes aliases that override standard commands
47
 
 
48
 
 * Giving the **--no-aliases** to the bzr command will tell it to ignore aliases
49
 
   for that run. For example, running **bzr --no-aliases commit** will perform a
50
 
   standard commit instead not do a **commit --strict**.
 
53
   an alias name that is the same as the orignal command. For example, default
 
54
   commit is changed with ``commit=commit --strict``.
 
55
 * Aliases cannot refer to other aliases. In other words making a
 
56
   ``lastlog`` alias and referring to it with a ``ll`` alias will not work.
 
57
   This includes aliases that override standard commands
 
58
 * Giving the ``--no-aliases`` to the bzr command will tell it to ignore aliases
 
59
   for that run. For example, running ``bzr --no-aliases commit`` will perform a
 
60
   standard commit instead not do a ``commit --strict``.
51
61