[Gambas-user] IDE Git Magic ....
Christof Thalhofer
chrisml at deganius.de
Thu Feb 8 21:39:28 CET 2018
Am 08.02.2018 um 18:36 schrieb Benoît Minisini:
> It's not easy to find a simple automatic behaviour with git.
Yes. It is a little more complicated than SVN. The reason is: Git has a
staging area, but not for nothing. To try to simplify this would cut off
one of the main advantages of Git!
> The logic behind is that the IDE add new files automatically, but
> that you have to commit as soon as possible if you want little
> commits.
Ok. Maybe I can explain it by a story of my work, as I do it everyday
with Git:
I am adding a new feature, maybe by adding a new module and a couple of
methods. These things usually rely on other things, which are spread
over other modules and classes and even projects (libraries). And while
I am developing the new feature, it is not unusual that I am detecting
some caveats in other parts of the software (things like misleading
comments, silly names of internal variables and so on), which I usually
fix on the fly. After an hour of working I normally do a couple of
commits, maybe three or four: The main feature and ... some commits of
the refactoring changes, which I did while coding and maybe another
commit of a new feature in a library, which resides in the same repo.
For that I need a clean stage. In the stage I can collect all things
that have changed, that belong together(!), for one explicit commit.
It is not helpful, when there are now all new files in the staging area,
automatically added by the IDE. In Git one is leaded to keep the commits
thematically consistent. For sure I prefer small commits. But it makes
no sense to commit things which do not belong together.
As long as the IDE is not able to decide, which change or which new file
belongs to which topic, every automatism of adding things to the staging
area only disturbs the kind of work which is done best with Git.
> I agree that you should be able to disable the automatic management
> if you want to do that yourself. By project maybe.
Please not. I have about 20 projects I am constantly working on. These
are some main projects, and a lot more libraries and some components. As
I do not change my kind of working style per project, I would strongly
prefer a central switch in the IDE. And if I get a project of other
people there would be no reason, why I should change my style of work or
change theirs by pushing a switch in another ones project.
> But I don't want to make it off by default, or I make the default an
> option, but then the default default would be enabling automatic
> management.
As I think, and I repeat this, every automatic management of adding
things to the staging area destroys the great advantage of Git
(especially over SVN): Keeping things in commits together. And
especially beginners could be directed in the wrong way by this.
If you want to support the usage of Git in the IDE in my experience it
would be far better if the IDE would provide a visual staging area,
where the programmer could collect changes and decide, which portion of
the changes to commit and when.
Examples of such staging areas you can find in the programs tig or gitg.
What I always miss is a very easy way to direct a small portion of
change to an explicit commit, while directing another change in the same
file nearby at the same time to another commit. It is possible in Git
and in tig but it is not really easy or intuitive. This could be a
killer feature.
Alles Gute
Christof Thalhofer
--
Dies ist keine Signatur
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20180208/3d5e33bf/attachment.sig>
More information about the User
mailing list