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

Re: How to check new commit availability without full fetch?

From
LRLeo Razoumov <slonik.az@gmail.com>
Date
Jan 11, 2010, 17:35 UTC
Message-ID
<ee2a733e1001110935h101e7ec9l1b4fcf2bf210f53f@mail.gmail.com>
In-Reply-To
<alpine.LFD.2.00.1001111149150.10143@xanadu.home>
On 2010-01-11, Nicolas Pitre <nico@fluxnic.net> wrote:
Show 33 quoted lines
> On Mon, 11 Jan 2010, Leo Razoumov wrote:
>
>  > On 2010-01-10, Nicolas Pitre <nico@fluxnic.net> wrote:
>  > >
>  > > You still don't answer my question though.  Again, _why_ do you need to
>  > >  know about remote commit availability without fetching them?
>  > >
>  >
>  > I use git to track almost all my data (code and otherwise) and spread
>  > it between several computers. I end up with several local repos having
>  > the same local branches. It happens once in a while that I fetch into
>  > a given remote/foo from several local foo branches from different
>  > machines and the operation fails. It happens because the commits have
>  > not been yet consistently distributed among the repos. To do the
>  > forensics and figure out who should update whom first I need a quick
>  > and non-destructive way to fetch dry-run.
>
>
> There is probably something awkward about your setup then.
>
>  Normally you should have a remote description for any of the remote
>  repositories you fetch from.  So if you have, say, remote machine_a with
>  repo foo, machine_b with repo bar, and machine_c with repo baz, then
>  fetching any of those will _only_ mirror locally the state of those
>  remote repositories.  There is no ordering required as there can't be
>  any conflicts in the mere fact of mirroring what the other guys have.
>  That's what remote tracking branches are for: they follow the state of a
>  remote repository and are never altered by local changes.  And you can
>  have as many of those as you wish and they will never conflict with each
>  other as each remote description is independent. And this is true
>  whether or not the remote repository lives on the same machine (that
>  would be a remote directory in that case).
>

Setup might be, indeed, awkward but it handles very diverse tasks. As I said in my earlier emails different repos fetch into the *same* remote/foo. So there could be conflicts and using fetch -f could cause loss of data.

Before switching to git I used mercurial for the same purpose and it has command that are equivalent to fetch --dry-run.

--Leo--
Previous: Nicolas PitreNext: Dmitry Potapov
Message 13 of 20 in “How to check new commit availability without full fetch?”
  1. Leo RazoumovJan 10, 2010
  2. Nicolas PitreJan 10, 2010
  3. Junio C HamanoJan 10, 2010
  4. Nicolas PitreJan 10, 2010
  5. Leo RazoumovJan 11, 2010
  6. Tay Ray ChuanJan 11, 2010
  7. Junio C HamanoJan 11, 2010
  8. Michael WittenJan 11, 2010
  9. Junio C HamanoJan 11, 2010
  10. Nicolas PitreJan 11, 2010
  11. Leo RazoumovJan 11, 2010
  12. Nicolas PitreJan 11, 2010
  13. Leo RazoumovJan 11, 2010
  14. Dmitry PotapovJan 11, 2010
  15. Robin RosenbergJan 11, 2010
  16. Junio C HamanoJan 11, 2010
  17. Nicolas PitreJan 11, 2010
  18. Junio C HamanoJan 11, 2010
  19. Nicolas PitreJan 11, 2010
  20. Andreas SchwabJan 11, 2010

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.