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

Re: [PATCH] More test cases for sanitized path names

From
Robin Rosenberg <robin.rosenberg.lists@dewire.com>
Date
Feb 1, 2008, 14:17 UTC
Message-ID
<200802011517.28895.robin.rosenberg.lists@dewire.com>
In-Reply-To
<7v63x99dt9.fsf@gitster.siamese.dyndns.org>
fredagen den 1 februari 2008 skrev Junio C Hamano:
Show 30 quoted lines
> Robin Rosenberg <robin.rosenberg.lists@dewire.com> writes:
> 
> >> > +test_expect_failure 'add a directory outside the work tree' '
> >> > +	d1="$(cd .. ; pwd)" &&
> >> > +	git add "$d1"
> >> > +	echo $?
> >> > +'
> >
> > Oops. Remove the echo $?. It still fails, i.e. git add succeeds when
> > it shouldn't. I was double checking it just before sending the patch.
> 
> Ah, you found breakages.
> 
> I could not quite tell what you meant by these tests with
> test_expect_failure, either they were misuse or "currently fails
> but they shouldn't".  Coming up with a small reproducible
> failure case is 50% of solving the problem.  That's very
> appreciated.
> 
> In any case, I think the large-ish test framework update patch I
> sent tonight should go in very early post 1.5.4 cycle, so plesae
> use the new-and-improved test_expect_failure to mark these
> reproducible failure cases.  Also, there is no need for hurry
> for you to just send test cases without fixes.  When I say I do
> not take patches early, I do mean it --- I do not even take _my_
> own patches like the one you are following up on.  I've sent
> quite a many of them, and I think some are on 'pu' or 'offcuts',
> but most are only in the list archive.  If nobody cares deeply
> enough about them to test and resend with Tested-by: , I am not
> planning to go back to pick them up.

I had those test cases on my machine from my earlier work on absolute path names so I just ran them with your code and extracted those that failed and put them into your testsuite instead. That's why I sent them so early. Read them as comments on your patches, "oh you need to cover this too". It was simply very convenient for me, and hopefull for you, to supply them in patch form.

The reasone my code for absolute path names wasn't re-submitted was because I had some test cases that didn't pass. I don't really care how the problem is solved.

Show 6 quoted lines
> > Can we move the default trash one level down for all tests? That
> > would give us one free level to play with.
> 
> I'd rather not.  Most tests do not have to step outside and it
> is very handy to debug any breakage they find by always being
> able to go there with "cd t/trash".
The change would be to "cd t/trash/repo" instead. Not much different.
Show 8 quoted lines
> The updated get_pathspec() issues a warning message and returns
> the result that omits paths outside of the work tree.  It does
> not die (and it is intentional, by the way).  The callers that
> expect to always receive the same number of paths in the return
> value as argv+i they pass to get_pathspec() should be updated to
> notice that they got less than they passed in, if they care
> about this error condition, and --error-unmatch codepath is one
> of them.  I did not touch that in the weatherbaloon patch.

Git add in the current version on an absolute path outside the repo fails, so I think the updated one should. It really doesn't make sense.

ls-files outside the repo doesn't make sense either, but then the current version exits with 0 so I can't make the same reference to existing behaviour there. It just might break someone's script.

-- robin
Previous: Junio C HamanoNext: Junio C Hamano
Message 32 of 47 in “git-clean buglet”
  1. Johannes SixtJan 23, 2008
  2. Johannes SixtJan 23, 2008
  3. Johannes SchindelinJan 23, 2008
  4. Johannes SixtJan 23, 2008
  5. Fix off by one error in prep_exclude.Shawn Bohrer, Jan 27, 2008
  6. Johannes SchindelinJan 27, 2008
  7. Shawn BohrerJan 27, 2008
  8. Junio C HamanoJan 27, 2008
  9. Shawn BohrerJan 28, 2008
  10. Fix off by one error in prep_exclude.Shawn Bohrer, Jan 28, 2008
  11. Johannes SchindelinJan 28, 2008
  12. Junio C HamanoJan 28, 2008
  13. Junio C HamanoJan 28, 2008
  14. Johannes SixtJan 28, 2008
  15. Junio C HamanoJan 28, 2008
  16. Johannes SixtJan 28, 2008
  17. Junio C HamanoJan 28, 2008
  18. prefix_path(): disallow absolute pathsJohannes Schindelin, Jan 28, 2008
  19. prefix_path(): disallow absolute pathsJohannes Schindelin, Jan 28, 2008
  20. Junio C HamanoJan 29, 2008
  21. Junio C HamanoJan 29, 2008
  22. Junio C HamanoJan 29, 2008
  23. Junio C HamanoJan 29, 2008
  24. setup: sanitize absolute and funny paths in get_pathspec()Junio C Hamano, Jan 29, 2008
  25. Make blame accept absolute pathsRobin Rosenberg, Feb 1, 2008
  26. More test cases for sanitized path namesRobin Rosenberg, Feb 1, 2008
  27. Junio C HamanoFeb 1, 2008
  28. Robin RosenbergFeb 1, 2008
  29. Junio C HamanoFeb 1, 2008
  30. Junio C HamanoFeb 1, 2008
  31. Junio C HamanoFeb 1, 2008
  32. Robin RosenbergFeb 1, 2008
  33. Junio C HamanoFeb 1, 2008
  34. Karl HasselströmFeb 1, 2008
  35. Sane use of test_expect_failureJunio C Hamano, Feb 1, 2008
  36. Junio C HamanoFeb 2, 2008
  37. Junio C HamanoMar 7, 2008
  38. Robin RosenbergMar 7, 2008
  39. Johannes SchindelinJan 29, 2008
  40. Junio C HamanoJan 29, 2008
  41. Johannes SchindelinJan 29, 2008
  42. Johannes SixtJan 29, 2008
  43. Junio C HamanoJan 29, 2008
  44. Johannes SixtJan 29, 2008
  45. Junio C HamanoJan 29, 2008
  46. しらいしななこJan 29, 2008
  47. Junio C HamanoJan 30, 2008

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.