Re: [anjuta-devel] Automatically add project sources files when committing files



On 02/05/12 02:43 N.H., James Liggett wrote:
On 01/29/2012 02:43 AM, Sébastien Granjoux wrote:
Hi James,


I think it would be useful, in the git commit dialog, to display all
modified project source files not already in git and add them
automatically if they are selected.


This would fix the issue when creating a new project and when adding new
or already existing files to the project without needing the add to
version control check box. There is already a bug for this.
https://bugzilla.gnome.org/show_bug.cgi?id=663672
What do you think?

It sounds like a good idea in theory, but I would want to work out the
workflow a bit. If I understand the bug report correctly, it would go
something like this:

1. User creates a project
2. User loads the git plugin
3. The git plugin looks for new project files and runs git add on them
4. User tweaks the index if necessary and then commits the new project
skeleton.

Do I have this right? If so, it seems that we would want to do something
similar to what Arnel suggests in the bug: have the git plugin check for
new project files on every load. But I think just doing that could be a
problem, in that the git plugin could try to add new files to the index
every time it loads, not just after a new project is created. Is there
some way the git plugin can tell if a new project has been created?
What I mean before is like this:
The Git plugin will check if:
1. The project directory is a git repository. If not, run `git init'.
2. There's a current branch.
3. There's no commit yet.
4. There's no file in index.
Then all files will be added to the index.

The third one will not work if [2] is false, since the Git plugin (currently) do not show any commits if there's no current branch. The fourth one is necessary so that if the user tries to compile the project, the newly created files won't be added to the index (since there's already some files there).

This is only applicable to the creation of a project, since if there's already some files in the index (because the plugin added them after detection of new source files), then the user created another source file, the above steps will no longer add it to index (since [4] fails). Plus it needs to check [1], [2] and [3], which will be all false.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]