Re: [RFC] Two conceptually distinct commit commands
- From
Horst H. von Brand <vonbrand@inf.utfsm.cl>
- Date
- Dec 5, 2006, 00:52 UTC
- Message-ID
- <200612050052.kB50qcn2026534@laptop13.inf.utfsm.cl>
- In-Reply-To
- <cworth@cworth.org>
Carl Worth <cworth@cworth.org> wrote:
[...]
Show 18 quoted lines
> Proposal > ------- > Here are the two commit commands I would like to see in git: > > commit-index-content [paths...] > > Commits the content of the index for the given paths, (or all > paths in the index). The index content can be manipulated with > "git add", "git rm", "git mv", and "git update-index". > > commit-working-tree-content [paths...] > > Commits the content of the working tree for the given paths, (or > all tracked paths). Untracked files can be committed for the first > time by specifying their names on the command-line or by using > "git add" to add them just prior to the commit. Any rename or > removal of a tracked file will be detected and committed > automatically.
Edit somefile with, e.g, emacs: Get backup called somefile~ Realize that somefile is nonsense, delete it(s edited version) commit-working-tree-contents: Now you have the undesirable somefile~ saved
Edit somefile, utterly changing it: Get backup called somefile~ mv somefile newfile commit-working-tree-contents: somefile~ saved, newfile lost
Edit somefile a bit, move it to newfile. Make sure no backups left over. commit-working-tree-contents: somefile deleted, newfile lost
This is /not/ easy to get right, as it depends on what the user wants, and the random programs run in between git commands.
You need to tell git somehow what files you want saved, and which ones are junk. I.e., just the first command (unfortunately).
-- Dr. Horst H. von Brand User #22616 counter.li.org Departamento de Informatica Fono: +56 32 2654431 Universidad Tecnica Federico Santa Maria +56 32 2654239