Veracity Q&A home login about faq

One of my favourite features of the existing DVCSs is the ability to select individual changes within a file to go into a commit, e.g. darcs/hg record, or git add -p, allowing you to address the "tangled working copy problem" and produce a series of separate, logical commits, each of which does only one thing.

I've noted from Eric's blog that he has reservations about this approach, since it allows you to create changesets in your DAG that you have never tested. (http://www.ericsink.com/entries/git_index.html) However, Mercurial (or specifically, TortoiseHg) has an alternative approach to the problem in that rather than selecting chunks to commit, you select chunks to set aside in the shelve tool, or to revert altogether if need be. This approach addresses these concerns in that it allows you to untangle your working copy into a state where you can test it before you commit it.

Will Veracity be providing a similar tool, or any other form of solution to this problem? If so, what?

asked Oct 03 '11 at 17:22

jammycakes's gravatar image

jammycakes
36115


We will probably do something like this in the future, but it's not something we are working on right now.

link

answered Oct 04 '11 at 09:50

Eric%20Sink's gravatar image

Eric Sink ♦♦
6091814

An alternative approach would be to take advantage of Veracity's ability to easily have multiple working directories/checkouts. Simply create a new working directory (do a fresh checkout somewhere else on the disk) referencing the same changeset/baseline in your original working directory and then move over the changes that you want for the first logical commit; test and commit that. And repeat. Then discard (or revert/update) your original working directory.

With this method you can split up your changes into N logical changesets. You have the choice of making them completely independent (all starting from the same original changeset so you can merge them together later) or dependent (building sequentially upon the previous one).

Granted, this is a manual approach. But you can use DiffMerge (outside of 'vv') to compare the 2 working directories and help you move over the individual changes within a file.

link

answered Apr 11 '12 at 06:58

Jeff%20Hostetler's gravatar image

Jeff Hostetler ♦♦
1.7k927

DiffMerge really needs to support copying and deleting files.

(Aug 26 '12 at 09:38) Jace Browning

There is a relatively easy way to add support for hg record-like functionality to any VCS supporting status, cat and commit with explicit filenames. Algorithm is the following (grabbed from hg record and then implemented in aurum vim plugin):

  1. Get list of modified files
  2. Prompt user whether he choses to include specific file in the upcoming commit completely, exclude it or include partly.
  3. If user have chosen to include completely, just remember the name.
  4. If user have chosen to include partly, remember the name, move original file to {old-filename}.orig and prompt user about which changes he wants to include. Here is why cat command is needed: you can do like hg record and just throw away some hunks, reapplying modified diff to file contents and saving it to {old-filename}, like git add --interactive with ability to modify hunks, not just including/throwing them away, like aurum displaying file in a diffsplit and saving left window in {old-filename} or invent something own.
  5. Save modified file to {old-filename}.
  6. Run a commit with remembered names.
  7. Move all {old-filename}.orig back to {old-filename}.

This has nothing really VCS-dependent, only names of the commands. One can work on supporting veracity in my plugin if he needs to reuse existing implementation. I currently don’t know any other cross-VCS record implementations, but nobody says there are no.

link

answered Aug 26 '12 at 02:20

ZyX%20III's gravatar image

ZyX III
1

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×15

Asked: Oct 03 '11 at 17:22

Seen: 1,315 times

Last updated: Aug 26 '12 at 09:38

powered by OSQA