git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFCv1] git-p4: handle files with shell metacharacters
@ 2011-09-26 21:29 Luke Diamand
  2011-09-26 21:29 ` Luke Diamand
  0 siblings, 1 reply; 8+ messages in thread
From: Luke Diamand @ 2011-09-26 21:29 UTC (permalink / raw)
  To: git; +Cc: pw, vitor.hda, Luke Diamand

git-p4 uses the shell to execute perforce and git. This leads to problems
where files contain shell metacharacters or spaces. I first hit this
when someone checked in files with dollars ($) in their name, but in theory
you could cause complete havoc with other characters: backticks in a
filename would be especially entertaining.

Make git-p4 use subprocess.Popen() and subprocess.call() instead, and
pass in argv[] style arrays instead, at least for cases where filenames
are involved. Add test cases.

Notes:

This patch is based on Pete Wyckoff's recent patch series for refactoring
the git-p4 test harness, so it won't apply to the current next or master
branches.

I tried testing it on Cygwin as well, but the test harness appears to be
very broken on that platform as it is unable to start p4d.

Luke Diamand (1):
  git-p4: handle files with shell metacharacters

 contrib/fast-import/git-p4     |  174 +++++++++++++++++++++++++---------------
 t/t9800-git-p4.sh              |    2 +-
 t/t9803-git-shell-metachars.sh |   70 ++++++++++++++++
 3 files changed, 179 insertions(+), 67 deletions(-)
 create mode 100755 t/t9803-git-shell-metachars.sh

-- 
1.7.6.347.g4db0d

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-09-30  9:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-26 21:29 [PATCH/RFCv1] git-p4: handle files with shell metacharacters Luke Diamand
2011-09-26 21:29 ` Luke Diamand
2011-09-26 21:47   ` Pete Wyckoff
2011-09-27  8:40     ` [RFC/PATCHv2] " Luke Diamand
2011-09-27  8:40       ` Luke Diamand
2011-09-27  9:32       ` Luke Diamand
2011-09-27 13:03       ` Pete Wyckoff
2011-09-30  9:06         ` Luke Diamand

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 NNTP newsgroup(s).