Opened 4 years ago

Last modified 4 years ago

#4569 closed defect

dependencies are not ignored when using git due to ensure_dependencies.py — at Version 5

Reported by: erikvold Assignee: trev
Priority: P2 Milestone:
Module: Automation Keywords:
Cc: trev, kzar Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29359969/

Description (last modified by trev)

How to reproduce

  1. git clone https://github.com/adblockplus/adblockplus newdir
  2. ./build.py build
  3. git status

Observed behaviour

Multiple dependencies which ensure_dependencies.py has downloaded are not ignored, and are listed as changes when using git status.

Expected behaviour

All of the dependencies which ensure_dependencies.py has downloaded are ignored, and are not listed as changes when using git status.

Summary

Basically I think that https://github.com/adblockplus/adblockplus/blob/master/ensure_dependencies.py#L129-L132 has the issue somewhere.

I wonder if we really need this code though, I think we will constantly run into bugs or git/hg updates that need addressing which will cause this code to break. Would it not just be easier to explicitly list the dependences as folders to ignore in ignore files? and remove this code.

Background

Function _ensure_line_exists() always removes all previous content from the file instead of merely adding a line. It doesn't seek before reading file's contents, so it attempts reading from the end of the file. As a result, it doesn't read anything.

Change History (5)

comment:1 Changed 4 years ago by trev

  • Cc trev kzar added

comment:2 Changed 4 years ago by kzar

I can't reproduce this as described (I'm assuming step 1a. is cd newdir), the dependencies are ignored by Git as expected. What version of Git and Python do you have? (I have Git 2.9.3 and Python 2.7.12+.) Also just a hunch but are you using a case insensitive filesystem?

comment:3 Changed 4 years ago by trev

I can reproduce that on Mac OS X with Git 2.9.2 and Python 2.7.12. git status command shows adblockpluscore/ and buildtools/ as untracked but not adblockplusui/. The file system is case insensitive but that's not the reason - .git/info/exclude file only lists /adblockplusui but not the other dependencies.

comment:4 Changed 4 years ago by trev

  • Description modified (diff)
  • Owner set to trev

I identified the bug in _ensure_line_exists() function, added the analysis to the description.

comment:5 Changed 4 years ago by trev

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing
Note: See TracTickets for help on using tickets.