aegis -DIFFerence(1) General Commands Manual aegis -DIFFerence(1) NNAAMMEE aegis difference - find differences between a change and the baseline SSYYNNOOPPSSIISS aaeeggiiss --DDIIFFFFeerreennccee [ _f_i_l_e_n_a_m_e... ] [ _o_p_t_i_o_n... ] aaeeggiiss --DDIIFFFFeerreennccee --LLiisstt [ _o_p_t_i_o_n... ] aaeeggiiss --DDIIFFFFeerreennccee --HHeellpp DDEESSCCRRIIPPTTIIOONN The _a_e_g_i_s _-_D_I_F_F_e_r_e_n_c_e command is used to generate difference listings between source files in the the development directory and the base- line. The purpose is to enable reviewers to find each and every edit performed on the source files. The difference listings will be placed into files named for the sources files but with an additional ",D" suffix. The command used to perform the differences is specified in the _d_i_f_f___c_o_m_m_a_n_d field of the project configuration file (see _a_e_p_c_o_n_f(5) for more information). It is possible to configure a project to omit the diff step as unnec- essary, by the following setting: diff_command = "exit 0"; This disables all generation, checking and validation of difference file for each change source file. The merge functions of the _a_e_d_- _i_f_f(1) command are unaffected by this setting. Please note that the _h_i_s_t_o_r_y___c_o_n_t_e_n_t___l_i_m_i_t_a_t_i_o_n field of the project configuration file does nnoott apply to the _d_i_f_f___c_o_m_m_a_n_d field. If no files are named on the command line, all files in the change will be differenced. You may name a directory on the command line, and all files in the change in that directory tree will be differenced. FFiillee NNaammee IInntteerrpprreettaattiioonn The aegis program will attempt to determine the project file names from the file names given on the command line. All file names are stored within aegis projects as relative to the root of the baseline directory tree. The development directory and the integration direc- tory are shadows of this baseline directory, and so these relative names apply here, too. Files named on the command line are first con- verted to absolute paths if necessary. They are then compared with the baseline path, the development directory path, and the integration directory path, to determine a baseline-relative name. It is an error if the file named is outside one of these directory trees. The --BBAAssee__RREEllaattiivvee option may be used to cause relative filenames to be interpreted as relative to the baseline path; absolute filenames will still be compared with the various paths in order to determine a baseline-relative name. The _r_e_l_a_t_i_v_e___f_i_l_e_n_a_m_e___p_r_e_f_e_r_e_n_c_e in the user configuration file may be used to modify this default behavior. See _a_e_u_c_o_n_f(5) for more infor- mation. NNoottiiffiiccaattiioonn The actions of the command are controlled by the _d_i_f_f___c_o_m_m_a_n_d and _m_e_r_g_e___c_o_m_m_a_n_d fields of the project _c_o_n_f_i_g file. See _a_e_p_c_o_n_f(5) for more information. TTHHEE BBAASSEELLIINNEE LLOOCCKK The baseline lock is used to ensure that the baseline remains in a consistent state for the duration of commands which need to read the contents of files in the baseline. The commands which require the baseline to be consistent (these include the _a_e_b(1), _a_e_c_p(1) and _a_e_d(1) commands) take a baseline _r_e_a_d lock. This is a non-exclusive lock, so the concurrent development of changes is not hindered. The command which modifies the baseline, _a_e_i_p_a_s_s(1), takes a baseline _w_r_i_t_e lock. This is an exclusive lock, forcing _a_e_i_p_a_s_s(1) to block until there are no active baseline read locks. It is possible that one of the above development commands will block until an in-progress _a_e_g_i_s _-_I_n_t_e_g_r_a_t_e___P_A_S_S completes. This is usually of short duration while the project history is updated. The delay is essential so that these commands receive a consistent view of the baseline. No other integration command will cause the above develop- ment commands to block. When aegis' branch functionality is in use, a read (non-exclusive) lock is taken on the branch baseline and also each of the "parent" baselines. However, a baseline write (exclusive) lock is only taken on the branch baseline; the "parent" baselines are only read (non- exclusive) locked. FFiillee AAccttiioonn AAddjjuussttmmeenntt When this command runs, it first checks the change files against the projects files. If there are inconsistencies, the file actions will be adjusted as follows: create If a file is being created, but another change set is inte- grated which also creates the file, the file action in the change set still being developed will be adjusted to "modify". modify If a file is being modified, but another change set is inte- grated which removes the file, the file action in the change set still being developed will be adjusted to "create". remove If a file is being removed, but another change set is inte- grated which removes the file, the file will be dropped from the change set still being developed. CCOONNFFLLIICCTT RREESSOOLLUUTTIIOONN If the version of a file in the change is not the same as the version of the file in the baseline, it is out-of-date; some other change has altered the file while this change was being developed. When a difference is requested for an out-of-date file, a merge is performed between the common ancestor, the version in the baseline, and the version in the development directory. The command used to perform the merge is specified by the _m_e_r_g_e___c_o_m_m_a_n_d field of the project configuration file (see _a_e_p_c_o_n_f(5) for more information). Please note that the _h_i_s_t_o_r_y___c_o_n_t_e_n_t___l_i_m_i_t_a_t_i_o_n field of the project configuration file does nnoott apply to the _m_e_r_g_e___c_o_m_m_a_n_d field. After the merge is performed the version of the file will be changed to be the current version, marking the file as up to date, and a new build will be required. The original file in your development directory is preserved with an ",B" suffix (B for backup). The source file contains the result of the merge. You should edit the source files, to make sure the auto- matic merge has produced sensible results. This merge process works most of the time. Usually two changes to two logically separate areas of functionality will alter two logically separate parts of any files they may have in common. There are patho- logical cases where this merge process is spectacularly useless, but these are surprisingly rare in practice. If you don't want the automatic merge results, simply use the _m_v(1) command to restore the contents from the ",B" file. If any merges are required no differences will be performed. An error message and a non-zero exit status will also result. This is to ensure that developers notice that merges have been done, and that they reconcile the sources and the merged _,_D files before the next difference. See the --NNoo__MMeerrggee and --OOnnllyy__MMeerrggee options, below, for exact control of when merging is performed. CClloonniinngg aanndd MMeerrggiinngg When you use _a_e_c_l_o_n_e(1) to clone a change set, and then integrate one of the two change sets, you will observe that Aegis says that the files of the un-integrated change are now out-of-date. If you run _a_e_m(1) to bring the out-of-date files back up-to-date, _f_m_e_r_g_e(1) and some (but not) all other merging tools, it signals just about everything as a conflict, even though both alternatives are identical. The problem is that two changes making identical edits to the same place in the same file are a logical conflict, even if not an actual conflict, and it takes a human to figure out the difference. Think of a shopping list: the ensuite needs more soap, and so does the main bathroom. The second "soap" on the merge of the two shopping lists isn't a duplicate, you really do need two boxes of soap. Sometimes edits of source files are the same: sometimes the logical conflict is resolved by applying both identical edits, not just one. This is just the _f_m_e_r_g_e(1) command being more conservative than RCS's _m_e_r_g_e(1) command. The easiest way to deal with this common situation it to run an aecpu -unchanged command _b_e_f_o_r_e you run the _a_e_m(1) merge command, and you will have less grief. It's also worth remembering that Aegis stashes the origi- nal file with a ,B suffix (B for backup) so you can simply mv _f_u_b_a_r,B _f_u_b_a_r if you know that all of the conflicts are logical conflicts. IINNTTEEGGRRAATTIIOONN During integration, it is also necessary to difference a change. This provides the difference between the branch and its parent, for when development on a branch is completed and it is to be reviewed. The baseline of a branch is the development directory of the composite change it represents. OOPPTTIIOONNSS The following options are understood: --AANNttiicciippaattee _c_h_a_n_g_e_-_n_u_m_b_e_r This option is used to nominate a source for the reference files, rather than the baseline. This may be used to synchro- nize with a change without having to wait for it to arrive in the baseline. It is an error if the anticipated change is not in one of the _'_b_e_i_n_g _r_e_v_i_e_w_e_d_' or _'_a_w_a_i_t_i_n_g _i_n_t_e_g_r_a_t_i_o_n_' or _'_b_e_i_n_g _i_n_t_e_g_r_a_t_e_d_' states. A merge is always performed, because the anticipated change is "about" to make any common file out-of-date. You will still have to perform a "real" merge later. --BBRRaanncchh _n_u_m_b_e_r This option may be used to specify a different branch for the origin file, rather than the baseline. (See also --TTRRuunnkk option. Please Note: the --BBRRaanncchh option does not take a project name, just the branch number suffix. --GGrraannddPPaarreenntt This option may be used to specify the grandparent branch (one up from the current branch) for the origin file, rather than the baseline. (The -grandparent option is the same as the "-branch .." option.) --CChhaannggee _n_u_m_b_e_r This option may be used to specify a particular change within a project. See _a_e_g_i_s(1) for a complete description of this option. --HHeellpp This option may be used to obtain more information about how to use the _a_e_g_i_s program. --LLiisstt This option may be used to obtain a list of suitable subjects for this command. The list may be more general than expected. --NNoott__LLooggggiinngg This option may be used to disable the automatic logging of output and errors to a file. This is often useful when sev- eral aegis commands are combined in a shell script. --TTRRuunnkk This option may be used to specify the project trunk for the origin file, rather than the baseline. (See also --BBRRaanncchh option, the -trunk option is the same as the "-branch -" option.) --NNoo__MMeerrggee This option is used to cause only file differences to be gen- erated, even when file versions are out-of-date. If not set, the default is to use the _d_i_f_f___p_r_e_f_e_r_e_n_c_e field of the _a_e_u_- _c_o_n_f(5) file. --OOnnllyy__MMeerrggee This option is used to cause only file merges to be performed on files with out-of-date versions. Other source files are ignored. If not set, the default is to use the _d_i_f_f___p_r_e_f_e_r_- _e_n_c_e field of the _a_e_u_c_o_n_f(5) file. --AAuuttoommaattiicc__MMeerrggee This option is used to perform _-_O_n_l_y___M_e_r_g_e if any source files have out-of-date versions, otherwise _-_N_o___M_e_r_g_e _i_s _p_e_r_f_o_r_m_e_d_. Only merges or differences will be performed, it will never use a mixture. If not set, the default is to use the _d_i_f_f___p_r_e_f_e_r_e_n_c_e field of the _a_e_u_c_o_n_f(5) file. --PPrroojjeecctt _n_a_m_e This option may be used to select the project of interest. When no --PPrroojjeecctt option is specified, the _A_E_G_I_S___P_R_O_J_E_C_T envi- ronment variable is consulted. If that does not exist, the user's _$_H_O_M_E_/_._a_e_g_i_s_r_c file is examined for a default project field (see _a_e_u_c_o_n_f(5) for more information). If that does not exist, when the user is only working on changes within a sin- gle project, the project name defaults to that project. Oth- erwise, it is an error. --TTEERRssee This option may be used to cause listings to produce the bare minimum of information. It is usually useful for shell scripts. --VVeerrbboossee This option may be used to cause aegis to produce more output. By default aegis only produces output on errors. When used with the --LLiisstt option this option causes column headings to be added. --WWaaiitt This option may be used to require Aegis commands to wait for access locks, if they cannot be obtained immediately. Defaults to the user's _l_o_c_k___w_a_i_t___p_r_e_f_e_r_e_n_c_e if not specified, see _a_e_u_c_o_n_f(5) for more information. --NNoo__WWaaiitt This option may be used to require Aegis commands to emit a fatal error if access locks cannot be obtained immediately. Defaults to the user's _l_o_c_k___w_a_i_t___p_r_e_f_e_r_e_n_c_e if not specified, see _a_e_u_c_o_n_f(5) for more information. See also _a_e_g_i_s(1) for options common to all aegis commands. All options may be abbreviated; the abbreviation is documented as the upper case letters, all lower case letters and underscores (_) are optional. You must use consecutive sequences of optional letters. All options are case insensitive, you may type them in upper case or lower case or a combination of both, case is not important. For example: the arguments "-project", "-PROJ" and "-p" are all inter- preted to mean the --PPrroojjeecctt option. The argument "-prj" will not be understood, because consecutive optional characters were not supplied. Options and other command line arguments may be mixed arbitrarily on the command line, after the function selectors. The GNU long option names are understood. Since all option names for _a_e_g_i_s are long, this means ignoring the extra leading '-'. The "----_o_p_t_i_o_n==_v_a_l_u_e" convention is also understood. RREECCOOMMMMEENNDDEEDD AALLIIAASS The recommended alias for this command is csh% alias aed 'aegis -diff \!* -v' sh$ aed(){aegis -diff "$@" -v} For user's convenience, particularly when they have selected the "no merge" preference, there is also a merge alias: csh% alias aem 'aegis -diff -only_merge \!* -v' sh$ aem(){aegis -diff -only_merge $* -v} EERRRROORRSS It is an error if the change is not in the _b_e_i_n_g _d_e_v_e_l_o_p_e_d or _b_e_i_n_g _i_n_t_e_g_r_a_t_e_d states. EEXXIITT SSTTAATTUUSS The _a_e_g_i_s command will exit with a status of 1 on any error. The _a_e_g_i_s command will only exit with a status of 0 if there are no errors. EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS See _a_e_g_i_s(1) for a list of environment variables which may affect this command. See _a_e_p_c_o_n_f(5) for the project configuration file's _p_r_o_j_e_c_t___s_p_e_c_i_f_i_c field for how to set environment variables for all commands executed by Aegis. SSEEEE AALLSSOO _a_e_b(1) build also takes a baseline read lock (non-exclusive) _a_e_c_p(1) copy file also takes a baseline read lock (non-exclusive) _a_e_d_b(1) begin development of a change _a_e_i_p_a_s_s(1) integrate pass takes a baseline write lock (exclusive) _a_e_p_c_o_n_f(5) project configuration file format _a_e_u_c_o_n_f(5) user configuration file format CCOOPPYYRRIIGGHHTT aegis version 4.25.D611 Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Peter Miller The aegis program comes with ABSOLUTELY NO WARRANTY; for details use the '_a_e_g_i_s _-_V_E_R_S_i_o_n _L_i_c_e_n_s_e' command. This is free software and you are welcome to redistribute it under certain conditions; for details use the '_a_e_g_i_s _-_V_E_R_S_i_o_n _L_i_c_e_n_s_e' command. AAUUTTHHOORR Peter Miller E-Mail: pmiller@opensource.org.au /\/\* WWW: http://miller.emu.id.au/pmiller/ Reference Manual Aegis aegis -DIFFerence(1)