I've got a number of Python modules where the debugging code changes
on a regular basis, but is of no relevance to the history of the
file.  For a snippet, it might be something like

  def real_code(x):
    return do_stuff(x)

  # version everything above the next line
  if __name__ == "__main__":   # everything from here on
    filename = r"/tmp/thing"   # should be ignored
    f = real_code(x)           # every time
    print f["some arbitrary test case"]

The files are data-source files from providers, and the value I want
to check (the subscripting in this case) is usually some case with
which we're having a particular problem.  Because it's just there to
test new cases in the providers' data, and the tests aren't
available in every source data file (we don't keep huge histories of
the gigs of files/data to allow retesting later).

Currently, when I check it in, I do an "add -p" and just skip the
hunks after the "if __name__ ==".  I was wondering if there was a
better (i.e., automatic) way to delimit that a certain segment of
the file should never be considered "changed" and that git should
ignore it when adding/committing the file.



You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to