On Tue, Jan 19, 2010 at 2:10 AM, Andrew Thorburn <nzipsi_at_gmail.com> wrote:
> I'm wondering if there has been any discussion about the ability to
> commit bits and pieces of a file.
> I have a particular bit of code in a project I'm working on which is
> very large (too large), and I frequently need to make changes to it
> for multiple issues. This means that when I go to commit, I have to
> make a single commit which fixes or implements multiple issues. This
> isn't really ideal, as it means that you can't look at the diffs of
> the file to see which change applies to which issue - you just see a
> nice big list of changes, and have to guess at what changes apply to
> what issue.
> I can't always commit straight away, as I need to wait for
> confirmation that the fix is *actually* required, so I might move on
> to the next issue which could require changes to the same file.
> Ideally, I would like to be able to select the lines I want to commit
> (or not commit, as the case may be),
While I'd like to have such a feature in svn, I don't think this is
what you need (as Tyler also indicates in his response).
If you work on one issue after the other, you can commit your work on
some temporary branch (shelf,...). When it's decided that the fix is
needed, you can merge the changes from your temporary branch to your
main development branch easily. With this approach your work is cut
into pieces (per issue), it's safe in the repository and your working
copy is clean to continue working on other issues.
I'd never use a 'commit only these chunks of these files' tool on Java
code. You build and probably test your code before commit, and if you
only take parts of it and move those to the repository, you risk that
the resulting commit will break the build on your branch.
What such a tool would be handy for is when working with text files
(documents), HTML etc. I'm thinking of committing parts of a file,
reverting chunks of change set or marking such chunks as to-be-ignored
during a commit.
> but as far as I'm aware, this isn't possible with SVN, or any third-party tools?
Not that I'm aware of.
Received on 2010-01-19 18:17:51 CET