Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder2.hal-mli.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'algorithm': 0.03; 'wiki': 0.03; 'discard': 0.05; 'repository': 0.05; '-use': 0.07; 'filename': 0.07; 'tom': 0.07; 'python': 0.09; '(use': 0.09; '*is*': 0.09; 'directory)': 0.09; 'file"': 0.09; 'files:': 0.09; 'git': 0.09; 'timestamp': 0.09; 'useless': 0.09; 'cc:addr:python- list': 0.10; 'applies': 0.15; 'charset:iso-8859-7': 0.15; 'commit': 0.15; 'file,': 0.15; 'producing': 0.15; '100644': 0.16; 'attributes.': 0.16; 'benjamin': 0.16; 'cc:name:python list': 0.16; 'deleted:': 0.16; "file's": 0.16; 'hint': 0.16; 'identifiable': 0.16; 'task.': 0.16; 'string': 0.17; 'wrote:': 0.17; '>>>': 0.18; 'changes': 0.20; 'fairly': 0.21; 'file:': 0.22; 'init': 0.22; 'cc:2**0': 0.23; 'branch': 0.23; "i've": 0.23; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'url:wiki': 0.26; 'older': 0.27; 'skip:# 10': 0.27; 'message- id:@mail.gmail.com': 0.27; 'chris': 0.28; 'initial': 0.28; '>>>>': 0.29; 'cat': 0.29; 'hash': 0.29; 'initialized': 0.29; 'url:wikipedia': 0.29; 'no,': 0.29; 'reset': 0.29; '"the': 0.29; 'mode': 0.30; 'asking': 0.32; 'file': 0.32; 'problem': 0.33; 'another': 0.33; 'received:google.com': 0.34; 'done': 0.34; 'along': 0.35; 'said,': 0.35; 'pm,': 0.35; 'sometimes': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'add': 0.36; 'but': 0.36; 'url:org': 0.36; "i'll": 0.36; 'beyond': 0.37; 'does': 0.37; 'two': 0.37; 'being': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'mean': 0.38; 'some': 0.38; 'nothing': 0.38; 'url:en': 0.38; 'gives': 0.39; 'think': 0.40; 'identify': 0.61; 'tracking': 0.61; 'first': 0.61; 'here:': 0.62; 'subject: & ': 0.67; 'power': 0.74; 'article': 0.78; '(still': 0.84; '2013': 0.84; 'common,': 0.84; 'computers.': 0.84; 'oscar': 0.84; 'seriously,': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=dYpkE2QPihAejDpUjOvydMGrISSHVqJaX7mygv7rW8M=; b=CZl2J9eH8TNQaWolEgeiSOvmBmkKA/Pl+/QgyxrD9+qSTI3I3Mh5/BiZ5T+mIlv0fz MFAn/LWFwxNS7shZ1ZG7fDgLN49lCnPfVrGquFBX+FMKZf7O/JIEppHbvfcBiPjT1Em6 i75vgR02SoRmZm2W9DdxMzgNQCxD2/yjpCtRh9KwBCmwXmvBOCOcjyN1EN+Er22IESoK orOVDTgyLVoHN6lEs75DIjDYOdtx9pQ1VxJ58n8ze8BuOFE0efl/wVvpxU2axU0WRlw4 SURp+ZBj5osXx84wnjWoxxVuu4Su0DmoaRQAbi4cXbF6pwfhCzj+k/Gmy04WlqxlKjId M9iQ== MIME-Version: 1.0 X-Received: by 10.152.125.239 with SMTP id mt15mr5842675lab.26.1358811800513; Mon, 21 Jan 2013 15:43:20 -0800 (PST) In-Reply-To: References: <8deb6f5d-ff10-4b36-bdd6-36f9eed58e1e@googlegroups.com> <5dd4babd-716d-4542-ad36-e6a841b73ec3@googlegroups.com> <03581a24-9330-4019-bde9-61a607000d3d@googlegroups.com> <187d77e0-e948-46bf-acc5-668c446cf3aa@googlegroups.com> <239abe33-fa5b-41a9-ae80-5260b9b1bd9c@googlegroups.com> Date: Mon, 21 Jan 2013 23:43:20 +0000 Subject: Re: Uniquely identifying each & every html template From: Oscar Benjamin To: Tom P Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable Cc: Python List X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 108 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1358811802 news.xs4all.nl 6882 [2001:888:2000:d::a6]:46925 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:37236 On 21 January 2013 23:01, Tom P wrote: > On 01/21/2013 01:39 PM, Oscar Benjamin wrote: >> >> On 21 January 2013 12:06, Ferrous Cranus wrote: >>> >>> =D4=E7 =C4=E5=F5=F4=DD=F1=E1, 21 =C9=E1=ED=EF=F5=E1=F1=DF=EF=F5 2013 11= :31:24 =F0.=EC. UTC+2, =EF =F7=F1=DE=F3=F4=E7=F2 Chris >>> Angelico =DD=E3=F1=E1=F8=E5: >>>> >>>> >>>> Seriously, you're asking for something that's beyond the power of >>>> humans or computers. You want to identify that something's the same >>>> file, without tracking the change or having any identifiable tag. >>>> >>>> That's a fundamentally impossible task. >>> >>> >>> No, it is difficult but not impossible. >>> It just cannot be done by tagging the file by: >>> >>> 1. filename >>> 2. filepath >>> 3. hash (math algorithm producing a string based on the file's contents= ) >>> >>> We need another way to identify the file WITHOUT using the above >>> attributes. >> >> >> This is a very old problem (still unsolved I believe): >> http://en.wikipedia.org/wiki/Ship_of_Theseus >> > That wiki article gives a hint to a poosible solution -use a timestamp to > determine which key is valid when. In the Ship of Theseus, it is only argued that it is the same ship because people were aware of the incremental changes that took place along the way. The same applies here: if you don't track the incremental changes and the two files have nothing concrete in common, what does it mean to say that a file is "the same file" as some older file? That being said, I've always been impressed with the way that git can understand when I think that a file is the same as some older file (though it does sometimes go wrong): ~/tmp$ git init Initialized empty Git repository in /home/oscar/tmp/.git/ ~/tmp$ vim old.py ~/tmp$ cat old.py #!/usr/bin/env python print('This is a fairly useless script.') print("Maybe I'll improve it later...") ~/tmp$ git add old.py ~/tmp$ git status # On branch master # # Initial commit # # Changes to be committed: # (use "git rm --cached ..." to unstage) # # new file: old.py # ~/tmp$ git commit [master (root-commit) 8e91665] First commit 1 file changed, 4 insertions(+) create mode 100644 old.py ~/tmp$ ls old.py ~/tmp$ cat old.py > new.py ~/tmp$ rm old.py ~/tmp$ vim new.py ~/tmp$ cat new.py #!/usr/bin/env python print('This is a fairly useless script.') print("Maybe I'll improve it later...") print("Although, I've edited it somewhat, it's still useless") ~/tmp$ git status # On branch master # Changes not staged for commit: # (use "git add/rm ..." to update what will be committed) # (use "git checkout -- ..." to discard changes in working director= y) # # deleted: old.py # # Untracked files: # (use "git add ..." to include in what will be committed) # # new.py no changes added to commit (use "git add" and/or "git commit -a") ~/tmp$ git add -A . ~/tmp$ git status # On branch master # Changes to be committed: # (use "git reset HEAD ..." to unstage) # # renamed: old.py -> new.py # So it *is* Theseus' ship! Oscar