简体   繁体   中英

How to increase column width when performing text mode merge with ClearCase?

For automation/scripting purposes I rebase my ClearCase snapshot view on the UNIX command line using:

cleartool rebase -recommended -complete

Sometimes, while this command runs, even if my snapshot view does not contain any changes at all, I get prompted for manual input to solve some merge conflicts. Eg " Do you want INSERTION from file x? [yes/no] " or " Do you want DELETION from file y? " or " Do you want CHANGES from file z? [yes/no] ". Etc.

When this scenario happens " cleartool rebase -recommended -complete " shows just a few columns of context. I haven't counted, but it feels like only 20 characters are used in the width of the column that display the conflicting changes. With such a narrow view there's no way anyone can make useful merge decisions and it very often leads to bad merges (not to say broken builds).

How can one instruct " cleartool rebase -recommended -complete " to prompt with, say, 80 columns wide of context so one can at least clearly see what the conflicting parts of the code are?

Assume there are no X-Window server available so that graphical merging is not an option. And remember, this is for automation purposes.

Considering that only a non-UCM command like cleartool merge has a -column option, a workaround might be to:

  • skip those files with conflicts during the rebase
  • try and merge the source version with the currently checked out version of the file not yet rebased because of conflict, but with a column width larger.

That is:

-col/umns n

Establishes the overall width of side-by-side output.
The default width is 80; only the first 40 or so characters of corresponding difference lines appear.
If n does not exceed the default width, this option is ignored.

The merge would take place while usung the UCM activity set by the rebase, using the destination UCM view.

That would obviously doesn't scale well for many files with conflicts, but as I mentioned before, it could be a workaround .

The OP confirms in the comments that a GUI-based solution remains the way to go:

The alternative using X-Windows worked:

cleartool rebase -recommended -complete -gmerge

As one would expect, this has the same behavior as cleartool rebase -recommended -complete , except that it pops up the xmerge 3-way GUI tool if any non-trivial/non-auto-resolvable merge conflicts are encountered.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM