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

Re: Git push race condition?

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Apr 11, 2014, 07:46 UTC
Message-ID
<vpqob08qpez.fsf@anie.imag.fr>
In-Reply-To
<CAAyEjTO3JTNDxDWpX+k_Z-O9=8-Vu5uyT_1eK-A8nFXWVcyD6w@mail.gmail.com>
Show 19 quoted lines
> This finally happened again. Here's what the reflog looks like:
>
> 2805f68 master@{0}: push
> 96eebc0 master@{1}: push
> 75bd4a6 master@{2}: push
> abc30da master@{3}: push
> eba874f master@{4}: push
> 10981e7 master@{5}: push
> 76b3957 master@{6}: push
> 2e3ea06 master@{7}: push
> 9d4e778 master@{8}: push
> dbd70ae master@{9}: push
> 508ab4f master@{10}: push
> 36a0ce4 master@{11}: push
> ddc258e master@{12}: push
> cf025de master@{13}: push
> dbd70ae master@{14}: push
> 95d33eb master@{15}: push
> 75b8e9a master@{16}: push

You can have a look at the actual reflog (.git/logs/refs/heads/master) which contains a bit more information. It will show you the pairs (source, destination) for each change.

Normally, the destination of a push is the source of the next one, but that would be worth checking.

Show 6 quoted lines
> One interesting thing to note is that dbd70ae shows up at two separate
> points in the reflog though, one being directly before the 9d4e778
> commit that won the race. According to Gitlab's event log that commit
> was just pushed once, right after 95d33eb and before cf025de as it
> shows in master@{14} there. The fact that the same commit shows up
> again in master@{9} is interesting.

My interpretation is that someone/something did a non-fast forward push at master@{9}, which reverted the history back to dbd70ae, and then master@{8} did a fast-forward, non-race condition, absolutely normal push.

Look at the complete reflog line corresponding to master@{9}, it may give you more information.

> Now that it has happened again and I've got this data, I'm going to
> upgrade git but let me know if this provides any insight in the mean
> time.

If I were you, I'd keep a copy of the complete repo (including reflog & all) in case.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Scott Sandler
Message 17 of 17 in “Git push race condition?”
  1. Scott SandlerMar 24, 2014
  2. Matthieu MoyMar 24, 2014
  3. Scott SandlerMar 24, 2014
  4. Matthieu MoyMar 24, 2014
  5. Junio C HamanoMar 24, 2014
  6. Ævar Arnfjörð BjarmasonMar 24, 2014
  7. Scott SandlerMar 24, 2014
  8. Jeff KingMar 24, 2014
  9. Jeff KingMar 24, 2014
  10. Nasser GrainawiMar 24, 2014
  11. Scott SandlerMar 25, 2014
  12. Matthieu MoyMar 25, 2014
  13. Scott SandlerMar 25, 2014
  14. Matthieu MoyMar 25, 2014
  15. Jeff KingMar 25, 2014
  16. Scott SandlerApr 10, 2014
  17. Matthieu MoyApr 11, 2014

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.