git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to commit incomplete changes?

From
Alexey Shumkin <alex.crezoff@gmail.com>
Date
Dec 15, 2011, 06:44 UTC
Message-ID
<20111215104444.783303cf@ashu.dyn1.rarus.ru>
In-Reply-To
<4cfc9cf0515b1bc751f6aa0de4f55e2a@ulrik.uio.no>
>  Do people have any feelings or conventions for how and when to
> publish a series of commits where the first one(s) break something
> and the next ones clear it up?

I'm curiuos, why to you want to commit changes that break something separately from fixup?

Many conventions (as I know) use ideology that every commit must NOT BREAK existing code or tests. Every SHARED commit. Git design (as you must be already know) allows you to make/change/reorder as many commits as you want (before you share them or push to a "central" repository). So, you have not to be afraid to commit every your change, because you can always change/fixup/split your commits.

Usually, you introduce a feature in a branch. Also, your project must have (?) (mine do have) unit-tests, at least. And most changes must be tested. So, breakage must be discovered early, even after some other commits in that feature branch. In that case you can just make a fixup commit and then rebase it on a breakage commit with a "squash".

And only after all features made and all tests passed you can share them (push to another repo).

Show 10 quoted lines
>I've found some discussion, but with vague results.
> 
>  I'm about to commit some small edits which go together with bigger
>  generated changes.  It seems both more readable and more cherry-pick-
>  friendly to me to keep these in separate commits.
> 
>  What I've found is I can use a line in the commit message like
>      "Incomplete change, requires next commit (update foo/ dir)."
>  and, if there is any point, do a no-ff merge past the breakage.
> 
Previous: Hallvard B FurusethNext: Hallvard B Furuseth
Message 2 of 10 in “How to commit incomplete changes?”
  1. Hallvard B FurusethDec 14, 2011
  2. Alexey ShumkinDec 15, 2011
  3. Hallvard B FurusethDec 15, 2011
  4. Alexey ShumkinDec 15, 2011
  5. Alexey ShumkinDec 15, 2011
  6. Neal KreitzingerDec 15, 2011
  7. Junio C HamanoDec 16, 2011
  8. Hallvard Breien FurusethDec 16, 2011
  9. Hallvard Breien FurusethDec 16, 2011
  10. Tomas CarneckyDec 16, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.