git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
To: Junio C Hamano <gitster@pobox.com>, Duy Nguyen <pclouds@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: git fetch <remote> <branch> behaves weirdely when run in a worktree
Date: Thu, 04 Oct 2018 12:24:57 +0530	[thread overview]
Message-ID: <3F40923F-B596-403C-900D-6F411A0D1CE1@gmail.com> (raw)
In-Reply-To: <d876e0af6a860621ae80fde71069c5e2e6a71878.camel@gmail.com>



On 3 October 2018 00:13:06 GMT+05:30, Kaartic Sivaraam <kaartic.sivaraam@gmail.com> wrote:
>Hi,
>
>Sorry for the delay. Got a little busy over the weekend. I seem to have
>found the reason behind the issue in the mean time :-)
>

Oops, I forgot to mention there's more comments inline!

BTW, is there an issue if .git/HEAD and .git/index are owned by root? The owners seem to have changed since I created the worktree possibly due to the cron job. Just wondering if it might cause some issues.


>On Wed, 2018-09-26 at 10:05 -0700, Junio C Hamano wrote:
>> Duy Nguyen <pclouds@gmail.com> writes:
>> 
>> > On Wed, Sep 26, 2018 at 05:24:14PM +0200, Duy Nguyen wrote:
>> > > On Wed, Sep 26, 2018 at 6:46 AM Kaartic Sivaraam
>> > > <kaartic.sivaraam@gmail.com> wrote:
>> > > > This is the most interesting part of the issue. I **did not**
>run
>> > > > 'git fetch ...' in between those cat commands. I was surprised
>by
>> > > > how the contents of FETCH_HEAD are changing without me spawning
>any
>> > > > git processes that might change it. Am I missing something
>here? As
>> > > > far as i could remember, there wasn't any IDE running that
>might
>> > > > automatically spawn git commands especially in that work
>> > > > tree. Weird.
>> > 
>> > Maybe something like this could help track down that rogue "git
>fetch"
>> > process (it's definitely _some_ process writing to the wrong file;
>or
>> > some file synchronization thingy is going on). You can log more of
>> > course, but this is where FETCH_HEAD is updated.
>> 
>
>Thanks for the patch! It really helped me identify the issue.
>
>The actual culprit here doesn't seem to be Git itself. It was the "git-
>prompt" bash plug-in[1] I was using. It seems to be spawning "git
>fetch" for every command I type on shell. That answers why the
>FETCH_HEAD was being updated even though I wasn't explicitly running
>it. The git bash plug-in seems to be fetching changes for *all* the
>upstream branches. That answers why there FETCH_HEAD was populated with
>info about all the branches when I explicitly requested for the next
>branch. I've also verified that `git fetch origin next` works as
>intended (FETCH_HEAD has info only about orgin/next) when I turn-off
>the plug-in which confirms that it's the culprit. A cursory search
>found me a related issue[2] but I'm not sure if it's the exact same
>one.
>
>I could identify the culprit only with the help of Duy's patch. Thanks
>Duy! Sorry for not realising this earlier. I almost forgot I'm using it
>as I've been accustomed to it a lot.
>
>
>> Well, a background-ish thing could be some vendor-provided copy of
>> Git that has nothing to do with what Kaartic would be compiling with
>> this patch X-<.
>
>Fortunately, it wasn't the case here as the plug-in was using my
>manually-built version of Git :-)
>
>Thanks for the help!
>
>Tag-line: Sometimes tools become part of our workflow so much that we
>really don't realise their presence. It's an indication of a good tool
>but we should be aware of suspecting them when an issue arises!
>Something which I should have done to realise the issue ealier x-<
>
>
>References:
>[1]: https://github.com/magicmonty/bash-git-prompt
>[2]: https://github.com/magicmonty/bash-git-prompt/issues/125
>
>Thanks,
>Sivaraam

-- 
Sivaraam

Sent from my Android device with K-9 Mail. Please excuse my brevity.

  reply	other threads:[~2018-10-04  6:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-23 20:09 git fetch <remote> <branch> behaves weirdely when run in a worktree Kaartic Sivaraam
2018-09-24 15:17 ` Duy Nguyen
2018-09-25 18:44   ` Kaartic Sivaraam
2018-09-25 21:40     ` Junio C Hamano
2018-09-26  3:37       ` Kaartic Sivaraam
2018-09-26  4:46 ` Kaartic Sivaraam
2018-09-26 15:24   ` Duy Nguyen
2018-09-26 16:09     ` Duy Nguyen
2018-09-26 17:05       ` Junio C Hamano
2018-10-02 18:43         ` Kaartic Sivaraam
2018-10-04  6:54           ` Kaartic Sivaraam [this message]
2018-10-04  7:00             ` Duy Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F40923F-B596-403C-900D-6F411A0D1CE1@gmail.com \
    --to=kaartic.sivaraam@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).