Git Product home page Git Product logo

Comments (8)

betatim avatar betatim commented on July 1, 2024

Will this go in a callout box for the developing LHCb code lesson?

from first-analysis-steps.

kdungs avatar kdungs commented on July 1, 2024

What about svn status -u

from first-analysis-steps.

betatim avatar betatim commented on July 1, 2024

Personal preference, can we not teach people the horrible habit of commit -am? Below some personal opinion/justification:

If you learn git add you learn that you can add only some of the file to a commit to keep changes separated even though they are all there right now (maybe one day learning that you can even add individual hunks). The fact that you have to add things explicitly means you reduce the number of times you commit some kind of garbage that you didn't mean to.

commit -m is evil, because it encourages you to write single line, short commit messages. I can't remember how to put a line break in a commit message using the command line. With an editor popping open you have a few seconds to think and edit what you write. It also gives you one final chance to check that the files you are about to modify are the ones you want to modify and that you didn't forget anything.

If having to exit the editor or the wrong editor appearing is the problem, we can fix that. It slows you down marginally. Compared to having to re-read the docs and then fix the disaster you invariably cause when trying to re-write history after commits have been made, it is much quicker.

Strong vote for more explicit, less implicit. Though it seems lots of others don't share this opinion so we should do a quick survey.

Some say that this is too slow, or that it is confusing to have an editor open, all I know is that you get better commits this way.

from first-analysis-steps.

alexpearce avatar alexpearce commented on July 1, 2024

@betatim I was thinking to have it as a very short separate lesson, so as to not overload the LHCb development lesson.

@kdungs I did not know about that, looks useful! I'll include it.

I will also mention how SVN's branching model is much less lightweight than git's, such that development in LHCb is almost always done in the trunk/HEAD.

from first-analysis-steps.

alexpearce avatar alexpearce commented on July 1, 2024

@betatim I imagine the -am stuff is up to the Software Carpentry people, no? We/you should discuss those points with them before they teach it today, as I don't think we'll have the time to teach more git (plus we really wouldn't want to contradict them).

I agree that -am often misses the point of using git (very well-defined, small commits). The reason I mentioned it here is because svn commit -m is equivalent to git commit -am: SVN commits everything in the working directory that's changed. (You can specify individual files, but you can't do those piecemeal, like git commit -p, which I think is where the real power is.)

Personally, I switch between using -m and using an editor for commit messages, depending on what I want in the message; “evil” I would disagree with, and generally has a somewhat religious tone and should be avoided. You can use multiple -m flags for each line, e.g. git commit -m "First line stuff." -m "Second line stuff." but I agree that an editor is better for multiline commits.

from first-analysis-steps.

apuignav avatar apuignav commented on July 1, 2024

from first-analysis-steps.

saschastahl avatar saschastahl commented on July 1, 2024

When committing to LHCb software, I usually copy and paste what I wrote in the release notes.

from first-analysis-steps.

betatim avatar betatim commented on July 1, 2024

Good point on the commit -a, when we show off svn <-> git we should keep it as you can't make choices in svn.

And yes, this is more a religious/political debate and it seems like a lot of others disagree. I just feel the urge to tell people what I think is the "one true way". Before telling the SWC guys we should try and find out their thread (they must have one) where they discussed this.

from first-analysis-steps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.