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

Question on empty commit

From
LTLuben Tuikov <ltuikov@yahoo.com>
Date
Jan 14, 2006, 02:18 UTC
Message-ID
<20060114021800.4688.qmail@web31803.mail.mud.yahoo.com>
Hi,
Scenario:
trunk remote
  |
  \/
trunk local
     \
      `--> tree A
               \
                `--> tree B
         Figure 1.

This is the dependecny since project B depends on project A introduced in tree A. And merging is done as follows (branch per directory; everything but HEAD and index is shared):

cd trunk && git pull trunk cd ../treeA && git merge "merge trunk" HEAD trunk cd ../treeB && git merge "merge tree A" HEAD treeA

But this isn't the only way to do it since tree B depends only on the introduced into tree A project A, and both project A and project B depend on the trunk, as follows:

trunk remote
  |
  \/
trunk local
  \  \
   \  `--> tree A
    \          \
     `--------> `--> tree B
         Figure 2.

So at point in time t where tree B had been synced with tree A, and tree A had been synced with trunk, but trunk had _not_ been synced with remote trunk, a merge was done following Figure 2:

cd trunk && git pull trunk cd ../treeA && git merge "merge trunk" HEAD trunk cd ../treeB && git merge "merge trunk" HEAD trunk git merge "merge tree A" HEAD treeA

Now the last merge introduced an empty commit, since tree A and tree B had been in sync (only local and remote trunk had been out of sync). While it was expected that no commit would be introduced since they were in sync.

Was the empty commit correct behavior?
Thanks,
   Luben
Next: Junio C Hamano
Message 1 of 6 in “Question on empty commit”
  1. Luben TuikovJan 14, 2006
  2. Junio C HamanoJan 15, 2006
  3. Luben TuikovJan 16, 2006
  4. Luben TuikovJan 16, 2006
  5. Junio C HamanoJan 16, 2006
  6. Junio C HamanoJan 16, 2006

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.